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/step6_file.mal5
-rw-r--r--tests/step8_macros.mal7
-rw-r--r--tests/step9_try.mal2
4 files changed, 16 insertions, 0 deletions
diff --git a/tests/step4_if_fn_do.mal b/tests/step4_if_fn_do.mal
index 51ddbe9..ee30ea3 100644
--- a/tests/step4_if_fn_do.mal
+++ b/tests/step4_if_fn_do.mal
@@ -62,6 +62,8 @@
(= 2 (+ 1 1))
;=>true
(= nil 1)
+;=>false
+(= nil nil)
;=>true
(> 2 1)
diff --git a/tests/step6_file.mal b/tests/step6_file.mal
index 8198391..f102c34 100644
--- a/tests/step6_file.mal
+++ b/tests/step6_file.mal
@@ -22,6 +22,11 @@
;=>12
;;
+;; Testing that (do (do)) not broken by TCO
+(do (do 1 2))
+;=>2
+
+;;
;; -------- Optional Functionality --------
(load-file "../tests/incB.mal")
diff --git a/tests/step8_macros.mal b/tests/step8_macros.mal
index 93f3ea9..f2f62dc 100644
--- a/tests/step8_macros.mal
+++ b/tests/step8_macros.mal
@@ -15,6 +15,13 @@
;=>(8 9)
+;; Testing non-macro function
+(not (= 1 1))
+;=>false
+;;; This should fail if it is a macro
+(not (= 1 2))
+;=>true
+
;; Testing trivial macros
(defmacro! one (fn* () 1))
diff --git a/tests/step9_try.mal b/tests/step9_try.mal
index f5bcb58..aee7908 100644
--- a/tests/step9_try.mal
+++ b/tests/step9_try.mal
@@ -61,6 +61,8 @@
;=>6
(map double nums)
;=>(2 4 6)
+(map (fn* [x] (symbol? x)) (list 1 (symbol "two") "three"))
+;=>(false true false)
;;
;; Testing read-str and eval