85eb89de6476c0208ea516b76cbf1ae771e943e9
[fleet.git] / tests / choice / swap-test.fleet
1 // expected output
2 #expect 2
3 #expect 1
4 #expect 1
5 #expect 2
6
7 #expect 1
8 #expect 2
9 #expect 2
10 #expect 1
11
12 #expect 1
13 #expect 2
14 #expect 1
15 #expect 2
16 #expect 2
17 #expect 1
18
19 #expect 2
20 #expect 1
21 #expect 2
22 #expect 1
23 #expect 1
24 #expect 2
25
26 #expect 2
27 #expect 1
28 #expect 1
29 #expect 2
30 #expect 1
31 #expect 2
32
33 #expect 1
34 #expect 2
35 #expect 2
36 #expect 1
37 #expect 2
38 #expect 1
39
40 // ships required in order to run this code
41 #ship debug        : Debug
42 #ship choice       : Choice
43
44 // alternate values from choice1+choice2
45 choice.out1: [*] wait, take, sendto debug.in;
46 choice.out2: [*] wait, take, sendto debug.in;
47 debug.in:
48   [*] nop;
49   (*) notify choice.out1;
50   (*) take, deliver;
51   (*) notify choice.out2;
52   (*) take, deliver;
53   kill*;
54
55 choice.in1: take; [*] deliver;
56 choice.in2: take; [*] deliver;
57 1: sendto choice.in1;
58 2: sendto choice.in2;
59
60 choice.in:  [*] take, deliver;
61
62 0:  sendto choice.in.swapIfZero;
63 1:  sendto choice.in.swapIfZero;
64 0:  sendto choice.in.swapIfNonZero;
65 1:  sendto choice.in.swapIfNonZero;
66 -1: sendto choice.in.swapIfPositive;
67 0:  sendto choice.in.swapIfPositive;
68 1:  sendto choice.in.swapIfPositive;
69 -1: sendto choice.in.swapIfNonPositive;
70 0:  sendto choice.in.swapIfNonPositive;
71 1:  sendto choice.in.swapIfNonPositive;
72 -1: sendto choice.in.swapIfNegative;
73 0:  sendto choice.in.swapIfNegative;
74 1:  sendto choice.in.swapIfNegative;
75 -1: sendto choice.in.swapIfNonNegative;
76 0:  sendto choice.in.swapIfNonNegative;
77 1:  sendto choice.in.swapIfNonNegative;
78
79