summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'data/unit-testing/cast.fate')
-rw-r--r--data/unit-testing/cast.fate54
1 files changed, 27 insertions, 27 deletions
diff --git a/data/unit-testing/cast.fate b/data/unit-testing/cast.fate
index 94b8beb..519220f 100644
--- a/data/unit-testing/cast.fate
+++ b/data/unit-testing/cast.fate
@@ -2,32 +2,32 @@
(global string test_name)
-(set test_name ( CAST ))
+(set! test_name ( CAST ))
(global int i)
(global float f)
(global string s)
-(set i (cast int ( 42 )))
+(set! i (cast int ( 42 )))
-(assert (= (var i) 42) [FAILED] (var test_name) equality 1: (var i).)
+(assert! (= (var i) 42) [FAILED] (var test_name) equality 1: (var i).)
-(set f (cast float ( 42.57 )))
+(set! f (cast float ( 42.57 )))
-(assert (= (var f) 42.57) [FAILED] (var test_name) equality 2: (var f).)
+(assert! (= (var f) 42.57) [FAILED] (var test_name) equality 2: (var f).)
-(assert (= (var i) 42 (cast int (var f))) [FAILED] (var test_name) equality 3: (cast int (var f)).)
+(assert! (= (var i) 42 (cast int (var f))) [FAILED] (var test_name) equality 3: (cast int (var f)).)
;; TO INT
-(assert (= 42 (cast int 42.72)) [FAILED] (var test_name) float->int: (cast int 42.72).)
-(assert (= 42 (cast int (+ 40.70 2.02))) [FAILED] (var test_name) extra float->int: (cast int (+ 40.70 2.02)).)
-(assert (= 42 (cast int 42)) [FAILED] (var test_name) int->int: (cast int 42).)
-(assert (= 42 (cast int (+ 40 2))) [FAILED] (var test_name) extra int->int: (cast int (+ 40 2)).)
-(assert (= 42 (cast int ( 42 ))) [FAILED] (var test_name) string->int: (cast int ( 42 )).)
+(assert! (= 42 (cast int 42.72)) [FAILED] (var test_name) float->int: (cast int 42.72).)
+(assert! (= 42 (cast int (+ 40.70 2.02))) [FAILED] (var test_name) extra float->int: (cast int (+ 40.70 2.02)).)
+(assert! (= 42 (cast int 42)) [FAILED] (var test_name) int->int: (cast int 42).)
+(assert! (= 42 (cast int (+ 40 2))) [FAILED] (var test_name) extra int->int: (cast int (+ 40 2)).)
+(assert! (= 42 (cast int ( 42 ))) [FAILED] (var test_name) string->int: (cast int ( 42 )).)
;; TO FLOAT
-(assert
+(assert!
(>
0.05
(abs
@@ -39,7 +39,7 @@
)
[FAILED] (var test_name) float->float: (cast float 42.72).
)
-(assert
+(assert!
(> 0.05
(abs
(-
@@ -50,9 +50,9 @@
)
[FAILED] (var test_name) extra float->float: (cast float (+ 40.70 2.02)).
)
-(assert (= 42.0 (cast float 42)) [FAILED] (var test_name) int->float: (cast float 42).)
-(assert (= 42.0 (cast float (+ 40 2))) [FAILED] (var test_name) extra float->float: (cast float (+ 40 2)).)
-(assert
+(assert! (= 42.0 (cast float 42)) [FAILED] (var test_name) int->float: (cast float 42).)
+(assert! (= 42.0 (cast float (+ 40 2))) [FAILED] (var test_name) extra float->float: (cast float (+ 40 2)).)
+(assert!
(> 0.05
(abs
(-
@@ -65,14 +65,14 @@
)
;; TO BOOL
-(assert (= (true) (cast bool (true))) [FAILED] (var test_name) bool->bool: (cast bool (true)).)
-(assert (= (true) (cast bool (or (true) (false)))) [FAILED] (var test_name) extra bool->bool: (cast bool (or (true) (false))).)
-(assert (= (true) (cast bool ( true ))) [FAILED] (var test_name) string->bool: (cast bool ( true )).)
+(assert! (= (true) (cast bool (true))) [FAILED] (var test_name) bool->bool: (cast bool (true)).)
+(assert! (= (true) (cast bool (or (true) (false)))) [FAILED] (var test_name) extra bool->bool: (cast bool (or (true) (false))).)
+(assert! (= (true) (cast bool ( true ))) [FAILED] (var test_name) string->bool: (cast bool ( true )).)
;; TO STRING
-(assert (= ( 42 ) (cast string 42)) [FAILED] (var test_name) int->string: (cast string 42).)
-(assert (= ( 42 ) (cast string (+ 40 2))) [FAILED] (var test_name) extra int->string: (cast string (+ 40 2)).)
-(assert
+(assert! (= ( 42 ) (cast string 42)) [FAILED] (var test_name) int->string: (cast string 42).)
+(assert! (= ( 42 ) (cast string (+ 40 2))) [FAILED] (var test_name) extra int->string: (cast string (+ 40 2)).)
+(assert!
(> 0.05
(abs
(-
@@ -83,7 +83,7 @@
)
[FAILED] (var test_name) float->string: (cast string 42.72).
)
-(assert
+(assert!
(> 0.05
(abs
(-
@@ -94,10 +94,10 @@
)
[FAILED] (var test_name) extra float->string: (cast string (+ 40.7 2.02)).
)
-(assert (= ( true ) (cast string (true))) [FAILED] (var test_name) bool->string: (cast string (true)).)
-(assert (= ( true ) (cast string (or (true) (false)))) [FAILED] (var test_name) extra bool->string: (cast string (true)).)
-(assert (= ( something ) (cast string ( something ))) [FAILED] (var test_name) string->string: (cast string ( something )).)
+(assert! (= ( true ) (cast string (true))) [FAILED] (var test_name) bool->string: (cast string (true)).)
+(assert! (= ( true ) (cast string (or (true) (false)))) [FAILED] (var test_name) extra bool->string: (cast string (true)).)
+(assert! (= ( something ) (cast string ( something ))) [FAILED] (var test_name) string->string: (cast string ( something )).)
[COMPLETED] (var test_name)
-(end)
+(end!)