aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/step4_if_fn_do.mal2
-rw-r--r--tests/step7_quote.mal23
-rw-r--r--tests/step8_macros.mal22
3 files changed, 25 insertions, 22 deletions
diff --git a/tests/step4_if_fn_do.mal b/tests/step4_if_fn_do.mal
index 169ff8b..51ddbe9 100644
--- a/tests/step4_if_fn_do.mal
+++ b/tests/step4_if_fn_do.mal
@@ -61,6 +61,8 @@
;=>false
(= 2 (+ 1 1))
;=>true
+(= nil 1)
+;=>true
(> 2 1)
;=>true
diff --git a/tests/step7_quote.mal b/tests/step7_quote.mal
index 979b4a9..a8771bf 100644
--- a/tests/step7_quote.mal
+++ b/tests/step7_quote.mal
@@ -1,3 +1,26 @@
+;; Testing cons function
+(cons 1 (list))
+;=>(1)
+(cons 1 (list 2))
+;=>(1 2)
+(cons 1 (list 2 3))
+;=>(1 2 3)
+(cons (list 1) (list 2 3))
+;=>((1) 2 3)
+
+;; Testing concat function
+(concat)
+;=>()
+(concat (list 1 2))
+;=>(1 2)
+(concat (list 1 2) (list 3 4))
+;=>(1 2 3 4)
+(concat (list 1 2) (list 3 4) (list 5 6))
+;=>(1 2 3 4 5 6)
+(concat (concat))
+;=>()
+
+
;; Testing regular quote
(quote 7)
;=>7
diff --git a/tests/step8_macros.mal b/tests/step8_macros.mal
index 3f398d3..6564eae 100644
--- a/tests/step8_macros.mal
+++ b/tests/step8_macros.mal
@@ -1,25 +1,3 @@
-;; Testing cons function
-(cons 1 (list))
-;=>(1)
-(cons 1 (list 2))
-;=>(1 2)
-(cons 1 (list 2 3))
-;=>(1 2 3)
-(cons (list 1) (list 2 3))
-;=>((1) 2 3)
-
-;; Testing concat function
-(concat)
-;=>()
-(concat (list 1 2))
-;=>(1 2)
-(concat (list 1 2) (list 3 4))
-;=>(1 2 3 4)
-(concat (list 1 2) (list 3 4) (list 5 6))
-;=>(1 2 3 4 5 6)
-(concat (concat))
-;=>()
-
;; Testing first function
(first '())
;=>nil