aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/step6_file.mal13
-rw-r--r--tests/stepA_more.mal18
2 files changed, 28 insertions, 3 deletions
diff --git a/tests/step6_file.mal b/tests/step6_file.mal
index 1f4f756..8198391 100644
--- a/tests/step6_file.mal
+++ b/tests/step6_file.mal
@@ -1,3 +1,16 @@
+;; Testing read-string, eval and slurp
+
+(read-string "(+ 2 3)")
+;=>(+ 2 3)
+
+(eval (read-string "(+ 2 3)"))
+;=>5
+
+;;; TODO: fix newline matching so that this works
+;;;(slurp "../tests/test.txt")
+;;;;=>"A line of text\n"
+
+
;; Testing load-file
(load-file "../tests/inc.mal")
diff --git a/tests/stepA_more.mal b/tests/stepA_more.mal
index 4d2acf9..0378c58 100644
--- a/tests/stepA_more.mal
+++ b/tests/stepA_more.mal
@@ -66,6 +66,12 @@
(read-string "(1 2 (3 4) nil)")
;=>(1 2 (3 4) nil)
+(read-string "7 ;; comment")
+;=>7
+
+(read-string ";; comment")
+;=>nil
+
(eval (read-string "(+ 4 5)"))
;=>9
@@ -91,6 +97,15 @@
(sequential? "abc")
;=>false
+;; Testing vector functions
+
+(vector? [10 11])
+;=>true
+(vector? '(12 13))
+;=>false
+(vector 3 4 5)
+;=>[3 4 5]
+
;; Testing conj function
(conj (list) 1)
;=>(1)
@@ -198,9 +213,6 @@
(meta (fn* (a) a))
;=>nil
-(meta +)
-;=>nil
-
(with-meta [1 2 3] {"a" 1})
;=>[1 2 3]