| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2021-05-01 20:58:23 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2021-05-01 20:58:23 +0200 |
| commit | 034153205de05ef2a4facf7aded9912ce8dfb6b5 (patch) | |
| tree | 963eaad7baedcea998e6a41b62e3cedd7d8c6ba9 /data/unit-testing/count.fate | |
| parent | a5ddb05e399929e778f501c864c894b32da3c354 (diff) | |
Suffixes imperative stuff with '!', adds ({set,list} ... ) shorthands.
Diffstat (limited to 'data/unit-testing/count.fate')
| -rw-r--r-- | data/unit-testing/count.fate | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/data/unit-testing/count.fate b/data/unit-testing/count.fate index 99fed3d..2c54998 100644 --- a/data/unit-testing/count.fate +++ b/data/unit-testing/count.fate @@ -2,9 +2,9 @@ (global string test_name) -(set test_name ( COUNT )) +(set! test_name ( COUNT )) -(assert (= (count 10 (range 0 60 1)) 1) +(assert! (= (count 10 (range 0 60 1)) 1) [FAILED] (var test_name) Failed to find 10 in range 0 60 1. ) @@ -15,7 +15,7 @@ (add_all! (range 0 10 1) li) (add_all! (range 0 10 1) li) -(assert (= (count 10 li) 4) +(assert! (= (count 10 li) 4) [FAILED] (var test_name) Failed to find 10 four times in li. ) @@ -26,7 +26,7 @@ (add_all! (range 0 10 1) si) (add_all! (range 0 10 1) si) -(assert (= (count 10 si) 1) +(assert! (= (count 10 si) 1) [FAILED] (var test_name) Failed to find 10 exactly once in si. ) @@ -37,7 +37,7 @@ (add! test2 ls) (add! test3 ls) -(assert (= (count test0 ls) 1) +(assert! (= (count test0 ls) 1) [FAILED] (var test_name) Failed to find test0 exactly once in ls. ) @@ -54,25 +54,25 @@ (add! test2 ls) (add! test3 ls) -(assert (= (count test0 ls) 4) +(assert! (= (count test0 ls) 4) [FAILED] (var test_name) Failed to find test0 four times in ls. ) (global (list bool) lb) (local int i) -(for (set i 0) (=< i 10) (set i (+ i 1)) +(for (set! i 0) (=< i 10) (set! i (+ i 1)) (add! (= (mod i 2) 0) lb) ) -(assert (= (count (true) lb) 6) +(assert! (= (count (true) lb) 6) [FAILED] (var test_name) Failed to find six even numbers. ) -(assert (= (count (false) lb) 5) +(assert! (= (count (false) lb) 5) [FAILED] (var test_name) Failed to find four odd numbers. ) [COMPLETED] (var test_name) -(end) +(end!) |


