| 
									
										
										
										
											2013-03-07 17:11:01 -05:00
										 |  |  | ! Copyright (C) 2013 Doug Coleman. | 
					
						
							|  |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							| 
									
										
										
										
											2013-03-24 12:55:44 -04:00
										 |  |  | USING: math tools.test combinators.extras sequences ;
 | 
					
						
							| 
									
										
										
										
											2013-03-07 17:11:01 -05:00
										 |  |  | IN: combinators.extras.tests | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | { "a b" } | 
					
						
							|  |  |  | [ "a" "b" [ " " glue ] once ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | { "a b c" } | 
					
						
							|  |  |  | [ "a" "b" "c" [ " " glue ] twice ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | { "a b c d" } | 
					
						
							|  |  |  | [ "a" "b" "c" "d" [ " " glue ] thrice ] unit-test | 
					
						
							| 
									
										
										
										
											2013-03-24 12:55:44 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ { "negative" 0 "positive" } ] [ | 
					
						
							|  |  |  |     { -1 0 1 } [ | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |            { [ 0 > ] [ "positive" ] } | 
					
						
							|  |  |  |            { [ 0 < ] [ "negative" ] } | 
					
						
							|  |  |  |            [ ] | 
					
						
							|  |  |  |         } cond-case | 
					
						
							|  |  |  |     ] map
 | 
					
						
							|  |  |  | ] unit-test | 
					
						
							| 
									
										
										
										
											2013-03-24 22:34:39 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | { { 1 2 3 } } [ 1 { [ ] [ 1 + ] [ 2 + ] } cleave-array ] unit-test |