| 
									
										
										
										
											2015-07-02 13:34:01 -04:00
										 |  |  | USING: concurrency.combinators tools.test random kernel math | 
					
						
							| 
									
										
										
										
											2015-06-29 19:43:15 -04:00
										 |  |  | concurrency.mailboxes threads sequences accessors arrays | 
					
						
							|  |  |  | math.parser ;
 | 
					
						
							|  |  |  | IN: concurrency.combinators.tests | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ [ drop ] parallel-each ] must-infer | 
					
						
							|  |  |  | { 2 0 } [ [ 2drop ] 2parallel-each ] must-infer-as | 
					
						
							|  |  |  | [ [ ] parallel-map ] must-infer | 
					
						
							|  |  |  | { 2 1 } [ [ 2array ] 2parallel-map ] must-infer-as | 
					
						
							|  |  |  | [ [ ] parallel-filter ] must-infer | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-03 12:39:59 -04:00
										 |  |  | { { 1 4 9 } } [ { 1 2 3 } [ sq ] parallel-map ] unit-test | 
					
						
							| 
									
										
										
										
											2015-06-29 19:43:15 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-03 12:39:59 -04:00
										 |  |  | { { 1 4 9 } } [ { 1 2 3 } [ 1000000 random sleep sq ] parallel-map ] unit-test | 
					
						
							| 
									
										
										
										
											2015-06-29 19:43:15 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ { 1 2 3 } [ dup 2 mod 0 = [ "Even" throw ] when ] parallel-map ] | 
					
						
							|  |  |  | [ error>> "Even" = ] must-fail-with | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-03 12:39:59 -04:00
										 |  |  | { V{ 0 3 6 9 } } | 
					
						
							| 
									
										
										
										
											2017-06-01 17:59:35 -04:00
										 |  |  | [ 10 <iota> [ 3 mod zero? ] parallel-filter ] unit-test | 
					
						
							| 
									
										
										
										
											2015-06-29 19:43:15 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-03 12:39:59 -04:00
										 |  |  | { 10 } | 
					
						
							| 
									
										
										
										
											2015-06-29 19:43:15 -04:00
										 |  |  | [ | 
					
						
							|  |  |  |     V{ } clone
 | 
					
						
							| 
									
										
										
										
											2017-06-01 17:59:35 -04:00
										 |  |  |     10 <iota> over [ push ] curry parallel-each | 
					
						
							| 
									
										
										
										
											2015-06-29 19:43:15 -04:00
										 |  |  |     length
 | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-03 12:39:59 -04:00
										 |  |  | { { 10 20 30 } } [ | 
					
						
							| 
									
										
										
										
											2015-06-29 19:43:15 -04:00
										 |  |  |     { 1 4 3 } { 10 5 10 } [ * ] 2parallel-map | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-03 12:39:59 -04:00
										 |  |  | { { -9 -1 -7 } } [ | 
					
						
							| 
									
										
										
										
											2015-06-29 19:43:15 -04:00
										 |  |  |     { 1 4 3 } { 10 5 10 } [ - ] 2parallel-map | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ | 
					
						
							|  |  |  |     { 1 4 3 } { 1 0 1 } [ / drop ] 2parallel-each | 
					
						
							|  |  |  | ] must-fail | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-03 12:39:59 -04:00
										 |  |  | { 20 } | 
					
						
							| 
									
										
										
										
											2015-06-29 19:43:15 -04:00
										 |  |  | [ | 
					
						
							|  |  |  |     V{ } clone
 | 
					
						
							| 
									
										
										
										
											2017-06-02 18:39:40 -04:00
										 |  |  |     10 <iota> 10 <iota> pick [ [ push ] [ push ] bi ] curry 2parallel-each | 
					
						
							| 
									
										
										
										
											2015-06-29 19:43:15 -04:00
										 |  |  |     length
 | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ { f } [ "OOPS" throw ] parallel-each ] must-fail | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-03 12:39:59 -04:00
										 |  |  | { "1a" "4b" "3c" } [ | 
					
						
							| 
									
										
										
										
											2015-06-29 19:43:15 -04:00
										 |  |  |     2
 | 
					
						
							|  |  |  |     { [ 1 - ] [ sq ] [ 1 + ] } parallel-cleave | 
					
						
							|  |  |  |     [ number>string ] 3 parallel-napply | 
					
						
							|  |  |  |     { [ "a" append ] [ "b" append ] [ "c" append ] } parallel-spread | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | { H{ { 0 4 } { 2 6 } { 4 8 } } } [ | 
					
						
							|  |  |  |     H{ { 1 2 } { 3 4 } { 5 6 } } [ | 
					
						
							|  |  |  |         [ 1 - ] [ 2 + ] bi*
 | 
					
						
							|  |  |  |     ] parallel-assoc-map | 
					
						
							|  |  |  | ] unit-test |