| 
									
										
										
										
											2016-03-22 10:56:41 -04:00
										 |  |  | USING: accessors arrays kernel kernel.private layouts literals math | 
					
						
							|  |  |  | sequences tools.test vectors ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-02-06 14:47:19 -05:00
										 |  |  | [ -2 { "a" "b" "c" } nth ] must-fail | 
					
						
							|  |  |  | [ 10 { "a" "b" "c" } nth ] must-fail | 
					
						
							|  |  |  | [ "hi" -2 { "a" "b" "c" } set-nth ] must-fail | 
					
						
							|  |  |  | [ "hi" 10 { "a" "b" "c" } set-nth ] must-fail | 
					
						
							| 
									
										
										
										
											2015-07-02 20:28:17 -04:00
										 |  |  | { f } [ { "a" "b" "c" } dup clone eq? ] unit-test | 
					
						
							|  |  |  | { "hi" } [ "hi" 1 { "a" "b" "c" } clone [ set-nth ] keep second ] unit-test | 
					
						
							|  |  |  | { V{ "a" "b" "c" } } [ { "a" "b" "c" } >vector ] unit-test | 
					
						
							|  |  |  | { f } [ { "a" "b" "c" } dup >array eq? ] unit-test | 
					
						
							|  |  |  | { t } [ { "a" "b" "c" } dup { } like eq? ] unit-test | 
					
						
							|  |  |  | { t } [ { "a" "b" "c" } dup dup length vector boa underlying>> eq? ] unit-test | 
					
						
							|  |  |  | { V{ "a" "b" "c" } } [ { "a" "b" "c" } V{ } like ] unit-test | 
					
						
							|  |  |  | { { "a" "b" "c" } } [ { "a" } { "b" "c" } append ] unit-test | 
					
						
							|  |  |  | { { "a" "b" "c" "d" "e" } } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | [ { "a" } { "b" "c" } { "d" "e" } 3append ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-02-06 14:47:19 -05:00
										 |  |  | [ -1 f <array> ] must-fail | 
					
						
							|  |  |  | [ cell-bits cell log2 - 2^ f <array> ] must-fail | 
					
						
							| 
									
										
										
										
											2014-06-03 12:52:38 -04:00
										 |  |  | ! To big for a fixnum #1045 | 
					
						
							| 
									
										
										
										
											2014-06-07 08:36:53 -04:00
										 |  |  | [ 67 2^ 3 <array> ] [ | 
					
						
							| 
									
										
										
										
											2016-03-22 10:56:41 -04:00
										 |  |  |     ${ KERNEL-ERROR ERROR-OUT-OF-FIXNUM-RANGE 147573952589676412928 f } | 
					
						
							| 
									
										
										
										
											2014-06-07 08:36:53 -04:00
										 |  |  |     =
 | 
					
						
							|  |  |  | ] must-fail-with | 
					
						
							| 
									
										
										
										
											2015-10-28 19:48:18 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | { t } [ | 
					
						
							|  |  |  |     1 2 2array pair?
 | 
					
						
							|  |  |  | ] unit-test |