| 
									
										
										
										
											2008-03-01 17:00:45 -05:00
										 |  |  | IN: concurrency.combinators.tests | 
					
						
							| 
									
										
										
										
											2008-02-18 17:20:18 -05:00
										 |  |  | USING: concurrency.combinators tools.test random kernel math  | 
					
						
							| 
									
										
										
										
											2008-11-19 17:01:48 -05:00
										 |  |  | concurrency.mailboxes threads sequences accessors arrays | 
					
						
							|  |  |  | math.parser ;
 | 
					
						
							| 
									
										
										
										
											2008-02-18 17:20:18 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ [ drop ] parallel-each ] must-infer | 
					
						
							| 
									
										
										
										
											2008-05-06 22:23:07 -04:00
										 |  |  | { 2 0 } [ [ 2drop ] 2parallel-each ] must-infer-as | 
					
						
							| 
									
										
										
										
											2008-02-18 17:20:18 -05:00
										 |  |  | [ [ ] parallel-map ] must-infer | 
					
						
							| 
									
										
										
										
											2008-05-06 22:23:07 -04:00
										 |  |  | { 2 1 } [ [ 2array ] 2parallel-map ] must-infer-as | 
					
						
							| 
									
										
										
										
											2008-04-26 00:17:08 -04:00
										 |  |  | [ [ ] parallel-filter ] must-infer | 
					
						
							| 
									
										
										
										
											2008-02-18 17:20:18 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ { 1 4 9 } ] [ { 1 2 3 } [ sq ] parallel-map ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-19 02:50:05 -05:00
										 |  |  | [ { 1 4 9 } ] [ { 1 2 3 } [ 1000000 random sleep sq ] parallel-map ] unit-test | 
					
						
							| 
									
										
										
										
											2008-02-18 17:20:18 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ { 1 2 3 } [ dup 2 mod 0 = [ "Even" throw ] when ] parallel-map ] | 
					
						
							| 
									
										
										
										
											2008-04-14 08:53:54 -04:00
										 |  |  | [ error>> "Even" = ] must-fail-with | 
					
						
							| 
									
										
										
										
											2008-02-18 17:20:18 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ V{ 0 3 6 9 } ] | 
					
						
							| 
									
										
										
										
											2008-04-26 00:17:08 -04:00
										 |  |  | [ 10 [ 3 mod zero? ] parallel-filter ] unit-test | 
					
						
							| 
									
										
										
										
											2008-02-18 17:20:18 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ 10 ] | 
					
						
							|  |  |  | [ | 
					
						
							|  |  |  |     V{ } clone
 | 
					
						
							|  |  |  |     10 over [ push ] curry parallel-each | 
					
						
							|  |  |  |     length
 | 
					
						
							|  |  |  | ] unit-test | 
					
						
							| 
									
										
										
										
											2008-05-06 22:23:07 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ { 10 20 30 } ] [ | 
					
						
							|  |  |  |     { 1 4 3 } { 10 5 10 } [ * ] 2parallel-map | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ { -9 -1 -7 } ] [ | 
					
						
							|  |  |  |     { 1 4 3 } { 10 5 10 } [ - ] 2parallel-map | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ | 
					
						
							|  |  |  |     { 1 4 3 } { 1 0 1 } [ / drop ] 2parallel-each | 
					
						
							|  |  |  | ] must-fail | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ 20 ] | 
					
						
							|  |  |  | [ | 
					
						
							|  |  |  |     V{ } clone
 | 
					
						
							|  |  |  |     10 10 pick [ [ push ] [ push ] bi ] curry 2parallel-each | 
					
						
							|  |  |  |     length
 | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ { f } [ "OOPS" throw ] parallel-each ] must-fail | 
					
						
							| 
									
										
										
										
											2008-11-19 17:01:48 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ "1a" "4b" "3c" ] [ | 
					
						
							|  |  |  |     2
 | 
					
						
							|  |  |  |     { [ 1- ] [ sq ] [ 1+ ] } parallel-cleave | 
					
						
							|  |  |  |     [ number>string ] 3 parallel-napply | 
					
						
							|  |  |  |     { [ "a" append ] [ "b" append ] [ "c" append ] } parallel-spread | 
					
						
							|  |  |  | ] unit-test |