UI/Model Parse - Sliders - WIP
[clnl] / src / test / simpletests.lisp
index efc71f7359f316fe5e4875ca282c56394f00f924..aa6a309d9dc786f84fcb7e7ae580aa27a867a053 100644 (file)
@@ -15,6 +15,9 @@
 (defsimplecommandtest "Simple crt and fd" "crt 5 ask turtles [ fd 1 ]"
  "BEB43404EDC7852985A9A7FC312481785FE553A0")
 
+(defsimplecommandtest "Simple crt and fd 2" "crt 5 [ fd 1 ]"
+ "BEB43404EDC7852985A9A7FC312481785FE553A0")
+
 (defsimplecommandtest "Wrapping 1" "crt 5 ask turtles [ fd 5 ]"
  "1098A56973DA04E7AEA7659C40E3FF3EC7862B02")
 
 (defsimplereportertest "<= 3" "random-float 4 <= random-float 7" "false"
  "811837B74F63D10ABBC01DD59C1E7556706D9F7A")
 
+(defsimplereportertest "precedence 1" "5 + 3 * 2 - 1 * count patches + 8" "10"
+ "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
+
+(defsimplereportertest "precedence 2" "(5 + 3) * 2 - 1 * count patches + 8" "15"
+ "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
+
 (defsimplereportertest "any? 1" "any? turtles" "false"
  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
 
 (defsimplecommandtest "die 1" "crt 10 ask turtles [ die ]"
  "A665C1BF95E1F9CAAE9B9F8B2FBE3DAA45453136")
 
+(defsimplecommandtest "die 2" "crt 10 ask turtles [ hatch 1 die hatch 1 ]"
+ "DFB46C61ACB9A24004FF26B04DCB0AC32E90AA36")
+
+(defsimplecommandtest "die 3" "crt 5 ask turtles [ ask one-of turtles-here [ die ] hatch 1 ]"
+ "6D3B8351E71C03E479706C22172F6FACD2C558CE")
+
 (defreportertestwithsetup "any? 3" "crt 10 ask turtles [ die ]" "any? turtles" "false"
  "A665C1BF95E1F9CAAE9B9F8B2FBE3DAA45453136")
 
 (defsimplecommandtest "ifelse 2" "ifelse 5 = 4 [ crt 10 ] [ crt 5 ] if-else 5 = 4 [ crt 10 ] [ crt 5 ]"
  "A925E39EC022967568D238D31F70F0A375024A89")
 
+(defsimplecommandtest "ifelse 3" "ifelse 4 = 4 [ crt 5 crt 5 ] [ crt 10 crt 10 ]"
+ "A925E39EC022967568D238D31F70F0A375024A89")
+
+(defsimplecommandtest "ifelse 4" "ifelse 4 = 5 [ crt 5 crt 5 ] [ crt 10 crt 10 ]"
+ "2CF70DC9135754E77B64422C10E947E776E731E6")
+
+(defsimplecommandtest "not 1" "if not (5 = 5) [ crt 10 ]"
+ "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
+
+(defsimplecommandtest "not 2" "if not (5 = 4) [ crt 10 ]"
+ "A925E39EC022967568D238D31F70F0A375024A89")
+
 (defsimplereportertest "colors 1" "green" "55"
  "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
 
 (defsimplecommandtest "let 1" "let a 5 crt a"
  "9FE588C2749CD9CE66CB0EA451EFB80476E881FB")
 
-(defsimplecommandtest "let 2" "let a 5 let b 6 crt (a + b)"
+(defsimplecommandtest "let 2" "let a 5 let b 6 crt a + b"
  "4ABB6822402929878AB9E5A1084B9E4AE1F01D5B")
 
 (defsimplecommandtest "ticks 1" "reset-ticks tick"
- "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
+ "22A78AC53B666DE94611D566D814AD3EA7CC26AB")
 
-(defreportertestwithsetup "ticks 1" "reset-ticks tick tick" "ticks" "2"
- "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
+(defreportertestwithsetup "ticks 2" "reset-ticks tick tick" "ticks" "2"
+ "296AE6F478D03264745B0331EC5CEF578C37CAB9")
 
 (defreportertestwithsetup "of / who 1" "crt 10" "[ who ] of turtles" "[5 9 4 3 7 0 1 2 6 8]"
  "3F39BD2D8D5A1B2333E6C0DB665DBE3DCD5A75CE")
 (defreportertestwithsetup "one-of 3" "crt 10" "one-of turtles" "(turtle 5)"
  "A056ED8BF26A69FB4437E79F263E362C27F8820E")
 
+(defsimplereportertest "one-of 4" "one-of [green brown]" "35"
+ "0BDACB8E9D2BB768C01826E993B47D83D39FBD0C")
+
+(defsimplecommandtest "one-of 5" "crt 50 ask turtles [ set color one-of [green brown blue] ]"
+ "FD6AC9D531591C47FCE4E4AA0C4FA11CB7A06199")
+
+(defreportertestwithsetup "one-of / of" "crt 10" "[ color ] of one-of turtles" "65"
+ "A056ED8BF26A69FB4437E79F263E362C27F8820E")
+
+(defsimplecommandtest "one-of / ask" "crt 10 ask one-of turtles [ fd 1 ]"
+ "40106C3853F3870AAE37F232353115968A3A02F6")
+
 (defsimplecommandtest "color 1" "crt 10 ask turtles [ set color green ]"
  "20943094E2C70D5A12AC6EEB29E8E9E2D21BD87D")
 
 
 (defsimplecommandtest "size 1" "crt 10 ask turtles [ set size 5 ]"
  "8837CF2681A2091B0664FAA2C32062B19F548ED6")
+
+(defsimplereportertest "random 1" "random 100000" "85402"
+ "17D1BF7FF7BF2C7F3F5F7DD7CF67CFF2772CFFFC")
+
+(defreportertestwithsetup "random 2" "crt 10" "[ random 1000000 ] of turtles"
+ "[512564 490953 127774 976371 218233 692751 909837 655769 977588 485347]"
+ "2048ED1C553B0342D5DE1302577394CD09DE88DA")
+
+(defsimplecommandtest "setxy 1" "crt 10 ask turtles [ setxy random-xcor random-ycor ]"
+ "B02FD5B864A129AED5254A68C499607F7F6EA236")
+
+(defsimplereportertest "count 1" "count turtles" "0"
+ "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
+
+(defreportertestwithsetup "count 2" "crt 10" "count turtles" "10"
+ "A925E39EC022967568D238D31F70F0A375024A89")
+
+(defsimplereportertest "count 3" "count patches" "9"
+ "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
+
+(defreportertestwithsetup "with 1"
+ "crt 10 [ set color blue ] crt 10 [ set color green ]" "turtles with [ color = blue ]"
+ "(agentset, 10 turtles)"
+ "3FA51464CBF2AD493FA95A52E17768E1D8C8EFBB")
+
+(defreportertestwithsetup "with 2"
+ "crt 10 [ set color blue ] crt 10 [ set color green ]" "turtles with [ color = black ]"
+ "(agentset, 0 turtles)"
+ "3FA51464CBF2AD493FA95A52E17768E1D8C8EFBB")
+
+(defsimplereportertest "with 3" "patches with [ pcolor = green ]"
+ "(agentset, 0 patches)"
+ "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
+
+(defsimplecommandtest "hatch 1" "crt 10 ask turtles [ hatch 1 ]"
+ "29E3D1D3FAA14FC0D6E03DB1315932EEBC7CB1F1")
+
+(defsimplecommandtest "hatch 2" "crt 10 ask turtles [ hatch 1 [ fd .5 ] ] ask turtles [ fd .5 ]"
+ "58E3CBC869F26B7D9ABC0C05C58C29F2FD588912")
+
+(defsimplecommandtest "set-default-shapes 1" "crt 10 set-default-shape turtles \"sheep\" crt 10"
+ "F0B80936630E8B597CB1088493E3765B5B4A2137")
+
+(defreportertestwithsetup "round 1" "crt 10" "[ round random-float 1000 ] of turtles"
+ "[264 551 807 834 47 117 999 259 87 963]"
+ "2048ED1C553B0342D5DE1302577394CD09DE88DA")
+
+(defsimplereportertest "round 2" "round 1.5" "2"
+ "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
+
+(defsimplereportertest "round 3" "round 2.5" "3"
+ "E1DE30F072D785E0D0B59F28B0F7853E3D3E0D8B")
+
+(defsimplecommandtest "clear-all 1" "crt 10 ask patches [ set pcolor random 100 ] clear-all"
+ "7B5DF28923D7FD72158018A876DE8ED02CFB0882")
+
+(defsimplecommandtest "stop 1" "crt 10 stop crt 10"
+ "A925E39EC022967568D238D31F70F0A375024A89")
+
+(defsimplecommandtest "stop 2" "crt 10 ask turtles [ fd 1 stop fd 1 ]"
+ "A6C980CC9843CDD211ABD9C13899010D555F3DC5")
+
+(defsimplecommandtest "turtles-here 1"
+ "crt 1000 ask turtles [ fd random-float 10 ] ask turtles [ set label [ who ] of one-of turtles-here ]"
+ "F34192513765D221A15D939A2BC8FFE18B6ADF4C")