]> gitweb.factorcode.org Git - factor.git/blob - basis/concurrency/distributed/distributed-tests.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / concurrency / distributed / distributed-tests.factor
1 USING: tools.test concurrency.distributed kernel io.files
2 io.files.temp io.directories arrays io.sockets system
3 combinators threads math sequences concurrency.messaging
4 continuations accessors prettyprint ;
5 FROM: concurrency.messaging => receive send ;
6 IN: concurrency.distributed.tests
7
8 : test-node ( -- addrspec )
9     {
10         { [ os unix? ] [ "distributed-concurrency-test" temp-file <local> ] }
11         { [ os windows? ] [ "127.0.0.1" 1238 <inet4> ] }
12     } cond ;
13
14 [ ] [ [ "distributed-concurrency-test" temp-file delete-file ] ignore-errors ] unit-test
15
16 [ ] [ test-node dup (start-node) ] unit-test
17
18 [ ] [
19     [
20         receive first2 [ 3 + ] dip send
21         "thread-a" unregister-process
22     ] "Thread A" spawn
23     "thread-a" swap register-process
24 ] unit-test
25
26 [ 8 ] [
27     5 self 2array
28     "thread-a" test-node <remote-process> send
29
30     receive
31 ] unit-test
32
33 [ ] [ test-node stop-node ] unit-test