Prims - die halts execution
[clnl] / src / test / simpletests.lisp
1 (in-package #:clnl-test)
2
3 (defsimplecommandtest "Nothing" ""
4  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
5
6 (defsimplecommandtest "Simple crt" "crt 1"
7  "2F08B31AC06C9D5339E6B3E953C2B4B71FDB9CDE")
8
9 (defsimplecommandtest "Simple crt 2" "crt 5"
10  "9FE588C2749CD9CE66CB0EA451EFB80476E881FB")
11
12 (defsimplecommandtest "Simple crt and fd random" "crt 30 ask turtles [ fd random-float 1 ]"
13  "DED34D1D6492244E9E3813DE8DBF258F96636879")
14
15 (defsimplecommandtest "Simple crt and fd" "crt 5 ask turtles [ fd 1 ]"
16  "BEB43404EDC7852985A9A7FC312481785FE553A0")
17
18 (defsimplecommandtest "Simple crt and fd 2" "crt 5 [ fd 1 ]"
19  "BEB43404EDC7852985A9A7FC312481785FE553A0")
20
21 (defsimplecommandtest "Wrapping 1" "crt 5 ask turtles [ fd 5 ]"
22  "1098A56973DA04E7AEA7659C40E3FF3EC7862B02")
23
24 (defsimplecommandtest "Wrapping 2" "crt 5 ask turtles [ fd random-float 5 ]"
25  "1419DFA66EFB7F08FB30C7B63B256547212EB915")
26
27 (defsimplecommandtest "Wrapping 3" "crt 10 ask turtles [ fd -5 ]"
28  "53E4ECBD3C49FC8D3466563641CFCD7DCB5CD2AF")
29
30 (defsimplecommandtest "Wrapping 4" "crt 10 ask turtles [ fd random-float -5 ]"
31  "1258CE9CC93B52367E797F4C497BF95760EC7175")
32
33 (defsimplereportertest "Random 1" "random-float 5" "4.244088516651127"
34  "17D1BF7FF7BF2C7F3F5F7DD7CF67CFF2772CFFFC")
35
36 (defsimplereportertest "= 1" "5 = 5" "true"
37  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
38
39 (defsimplereportertest "= 2" "5 = 4" "false"
40  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
41
42 (defsimplereportertest "!= 1" "5 != 5" "false"
43  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
44
45 (defsimplereportertest "!= 2" "5 != 4" "true"
46  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
47
48 (defsimplereportertest "- 1" "5 - 5" "0"
49  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
50
51 (defsimplereportertest "- 2" "5 - 6" "-1"
52  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
53
54 (defsimplereportertest "- 3" "random-float 5 - random-float 5" "3.349608870016444"
55  "811837B74F63D10ABBC01DD59C1E7556706D9F7A")
56
57 (defsimplereportertest "+ 1" "5 + 5" "10"
58  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
59
60 (defsimplereportertest "+ 2" "5 + -6" "-1"
61  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
62
63 (defsimplereportertest "+ 3" "random-float 6 + random-float 6" "6.166281795942972"
64  "811837B74F63D10ABBC01DD59C1E7556706D9F7A")
65
66 (defsimplereportertest "* 1" "5 * 5" "25"
67  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
68
69 (defsimplereportertest "* 2" "5 * -6" "-30"
70  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
71
72 (defsimplereportertest "* 3" "random-float 4 * random-float 7" "4.251800892259665"
73  "811837B74F63D10ABBC01DD59C1E7556706D9F7A")
74
75 (defsimplereportertest "/ 1" "5 / 5" "1"
76  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
77
78 (defsimplereportertest "/ 2" "5 / -6" "-0.8333333333333334"
79  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
80
81 (defsimplereportertest "/ 3" "random-float 4 / random-float 7" "2.7112896835726876"
82  "811837B74F63D10ABBC01DD59C1E7556706D9F7A")
83
84 (defsimplereportertest "< 1" "5 < 5" "false"
85  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
86
87 (defsimplereportertest "< 2" "5 < 6" "true"
88  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
89
90 (defsimplereportertest "< 3" "random-float 4 < random-float 7" "false"
91  "811837B74F63D10ABBC01DD59C1E7556706D9F7A")
92
93 (defsimplereportertest "<= 1" "5 <= 5" "true"
94  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
95
96 (defsimplereportertest "<= 2" "5 <= 6" "true"
97  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
98
99 (defsimplereportertest "<= 3" "random-float 4 <= random-float 7" "false"
100  "811837B74F63D10ABBC01DD59C1E7556706D9F7A")
101
102 (defsimplereportertest "precedence 1" "5 + 3 * 2 - 1 * count patches + 8" "10"
103  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
104
105 (defsimplereportertest "precedence 2" "(5 + 3) * 2 - 1 * count patches + 8" "15"
106  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
107
108 (defsimplereportertest "any? 1" "any? turtles" "false"
109  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
110
111 (defreportertestwithsetup "any? 2" "crt 10" "any? turtles" "true"
112  "A925E39EC022967568D238D31F70F0A375024A89")
113
114 (defsimplecommandtest "die 1" "crt 10 ask turtles [ die ]"
115  "A665C1BF95E1F9CAAE9B9F8B2FBE3DAA45453136")
116
117 (defsimplecommandtest "die 2" "crt 10 ask turtles [ hatch 1 die hatch 1 ]"
118  "DFB46C61ACB9A24004FF26B04DCB0AC32E90AA36")
119
120 (defreportertestwithsetup "any? 3" "crt 10 ask turtles [ die ]" "any? turtles" "false"
121  "A665C1BF95E1F9CAAE9B9F8B2FBE3DAA45453136")
122
123 (defsimplecommandtest "rt 1" "crt 100 ask turtles [ fd random-float 5 rt random-float 180 fd random-float 4 ]"
124  "186B05DEFF6771BE791D54AB36A36874EC6E04FE")
125
126 (defsimplecommandtest "rt 2" "crt 100 ask turtles [ fd random-float 5 rt random-float 1080 fd random-float 4 ]"
127  "154C05DF7810C0FF5D7DDE51B76E1012FFB2C0E1")
128
129 (defsimplecommandtest "lt 1" "crt 100 ask turtles [ fd random-float 5 lt random-float 180 fd random-float 4 ]"
130  "D4B3844FE453C05E57537D6BA94C4B42C84655C6")
131
132 (defsimplecommandtest "lt 2" "crt 100 ask turtles [ fd random-float 5 lt random-float 1080 fd random-float 4 ]"
133  "07DEB6F4F007DB86CD8F2C2E10BD4E35CAD2B0CE")
134
135 (defsimplecommandtest "if 1" "if 5 = 5 [ crt 10 ]"
136  "A925E39EC022967568D238D31F70F0A375024A89")
137
138 (defsimplecommandtest "if 2" "if 5 = 4 [ crt 10 ]"
139  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
140
141 (defsimplecommandtest "ifelse 1" "ifelse 5 = 5 [ crt 10 ] [crt 5 ] if-else 5 = 5 [ crt 10 ] [ crt 5 ]"
142  "2CF70DC9135754E77B64422C10E947E776E731E6")
143
144 (defsimplecommandtest "ifelse 2" "ifelse 5 = 4 [ crt 10 ] [ crt 5 ] if-else 5 = 4 [ crt 10 ] [ crt 5 ]"
145  "A925E39EC022967568D238D31F70F0A375024A89")
146
147 (defsimplecommandtest "not 1" "if not (5 = 5) [ crt 10 ]"
148  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
149
150 (defsimplecommandtest "not 2" "if not (5 = 4) [ crt 10 ]"
151  "A925E39EC022967568D238D31F70F0A375024A89")
152
153 (defsimplereportertest "colors 1" "green" "55"
154  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
155
156 (defsimplereportertest "colors 2" "black" "0"
157  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
158
159 (defsimplecommandtest "let 1" "let a 5 crt a"
160  "9FE588C2749CD9CE66CB0EA451EFB80476E881FB")
161
162 (defsimplecommandtest "let 2" "let a 5 let b 6 crt a + b"
163  "4ABB6822402929878AB9E5A1084B9E4AE1F01D5B")
164
165 (defsimplecommandtest "ticks 1" "reset-ticks tick"
166  "22A78AC53B666DE94611D566D814AD3EA7CC26AB")
167
168 (defreportertestwithsetup "ticks 2" "reset-ticks tick tick" "ticks" "2"
169  "296AE6F478D03264745B0331EC5CEF578C37CAB9")
170
171 (defreportertestwithsetup "of / who 1" "crt 10" "[ who ] of turtles" "[5 9 4 3 7 0 1 2 6 8]"
172  "3F39BD2D8D5A1B2333E6C0DB665DBE3DCD5A75CE")
173
174 (defreportertestwithsetup "set / pcolor" "ask patches [ set pcolor green ]" "[ pcolor ] of patches"
175  "[55 55 55 55 55 55 55 55 55]"
176  "3E246C518581E004BC65EFB074A09BA2EEBB2910")
177
178 (defsimplereportertest "one-of 1" "one-of patches" "(patch -1 -1)"
179  "0BDACB8E9D2BB768C01826E993B47D83D39FBD0C")
180
181 (defsimplereportertest "one-of 2" "one-of turtles" "nobody"
182  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
183
184 (defreportertestwithsetup "one-of 3" "crt 10" "one-of turtles" "(turtle 5)"
185  "A056ED8BF26A69FB4437E79F263E362C27F8820E")
186
187 (defsimplereportertest "one-of 4" "one-of [green brown]" "35"
188  "0BDACB8E9D2BB768C01826E993B47D83D39FBD0C")
189
190 (defsimplecommandtest "one-of 5" "crt 50 ask turtles [ set color one-of [green brown blue] ]"
191  "FD6AC9D531591C47FCE4E4AA0C4FA11CB7A06199")
192
193 (defreportertestwithsetup "one-of / of" "crt 10" "[ color ] of one-of turtles" "65"
194  "A056ED8BF26A69FB4437E79F263E362C27F8820E")
195
196 (defsimplecommandtest "one-of / ask" "crt 10 ask one-of turtles [ fd 1 ]"
197  "40106C3853F3870AAE37F232353115968A3A02F6")
198
199 (defsimplecommandtest "color 1" "crt 10 ask turtles [ set color green ]"
200  "20943094E2C70D5A12AC6EEB29E8E9E2D21BD87D")
201
202 (defsimplecommandtest "label 1" "crt 10 ask turtles [ set label who ]"
203  "96BF63544678A06E0D9A5062613CE1CAD638FCD5")
204
205 (defsimplecommandtest "label-color 1" "crt 10 ask turtles [ set label-color green ]"
206  "70AB2BAA0BFD312256DDE6C02EE2B9C23E9B3532")
207
208 (defsimplecommandtest "size 1" "crt 10 ask turtles [ set size 5 ]"
209  "8837CF2681A2091B0664FAA2C32062B19F548ED6")
210
211 (defsimplereportertest "random 1" "random 100000" "85402"
212  "17D1BF7FF7BF2C7F3F5F7DD7CF67CFF2772CFFFC")
213
214 (defreportertestwithsetup "random 2" "crt 10" "[ random 1000000 ] of turtles"
215  "[512564 490953 127774 976371 218233 692751 909837 655769 977588 485347]"
216  "2048ED1C553B0342D5DE1302577394CD09DE88DA")
217
218 (defsimplecommandtest "setxy 1" "crt 10 ask turtles [ setxy random-xcor random-ycor ]"
219  "B02FD5B864A129AED5254A68C499607F7F6EA236")
220
221 (defsimplereportertest "count 1" "count turtles" "0"
222  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
223
224 (defreportertestwithsetup "count 2" "crt 10" "count turtles" "10"
225  "A925E39EC022967568D238D31F70F0A375024A89")
226
227 (defsimplereportertest "count 3" "count patches" "9"
228  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
229
230 (defreportertestwithsetup "with 1"
231  "crt 10 [ set color blue ] crt 10 [ set color green ]" "turtles with [ color = blue ]"
232  "(agentset, 10 turtles)"
233  "3FA51464CBF2AD493FA95A52E17768E1D8C8EFBB")
234
235 (defreportertestwithsetup "with 2"
236  "crt 10 [ set color blue ] crt 10 [ set color green ]" "turtles with [ color = black ]"
237  "(agentset, 0 turtles)"
238  "3FA51464CBF2AD493FA95A52E17768E1D8C8EFBB")
239
240 (defsimplereportertest "with 3" "patches with [ pcolor = green ]"
241  "(agentset, 0 patches)"
242  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
243
244 (defsimplecommandtest "hatch 1" "crt 10 ask turtles [ hatch 1 ]"
245  "29E3D1D3FAA14FC0D6E03DB1315932EEBC7CB1F1")
246
247 (defsimplecommandtest "hatch 2" "crt 10 ask turtles [ hatch 1 [ fd .5 ] ] ask turtles [ fd .5 ]"
248  "58E3CBC869F26B7D9ABC0C05C58C29F2FD588912")
249
250 (defsimplecommandtest "set-default-shapes 1" "crt 10 set-default-shape turtles \"sheep\" crt 10"
251  "F0B80936630E8B597CB1088493E3765B5B4A2137")
252
253 (defreportertestwithsetup "round 1" "crt 10" "[ round random-float 1000 ] of turtles"
254  "[264 551 807 834 47 117 999 259 87 963]"
255  "2048ED1C553B0342D5DE1302577394CD09DE88DA")
256
257 (defsimplereportertest "round 2" "round 1.5" "2"
258  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
259
260 (defsimplereportertest "round 3" "round 2.5" "3"
261  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
262
263 (defsimplecommandtest "clear-all 1" "crt 10 ask patches [ set pcolor random 100 ] clear-all"
264  "7B5DF28923D7FD72158018A876DE8ED02CFB0882")
265
266 (defsimplecommandtest "stop 1" "crt 10 stop crt 10"
267  "A925E39EC022967568D238D31F70F0A375024A89")
268
269 (defsimplecommandtest "stop 2" "crt 10 ask turtles [ fd 1 stop fd 1 ]"
270  "A6C980CC9843CDD211ABD9C13899010D555F3DC5")
271
272 (defsimplecommandtest "turtles-here 1"
273  "crt 1000 ask turtles [ fd random-float 10 ] ask turtles [ set label [ who ] of one-of turtles-here ]"
274  "F34192513765D221A15D939A2BC8FFE18B6ADF4C")