From 034153205de05ef2a4facf7aded9912ce8dfb6b5 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Sat, 1 May 2021 20:58:23 +0200 Subject: Suffixes imperative stuff with '!', adds ({set,list} ... ) shorthands. --- data/unit-testing/count.fate | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'data/unit-testing/count.fate') 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!) -- cgit v1.2.3-70-g09d2