1 ;;; TODO: really a step5 test
3 ;; Testing that (do (do)) not broken by TCO
8 ;; Testing read-string, eval and slurp
9 (read-string "(1 2 (3 4) nil)")
12 (= nil (read-string "nil"))
15 (read-string "(+ 2 3)")
18 (read-string "\"\n\"")
21 (read-string "7 ;; comment")
24 ;;; Differing output, but make sure no fatal error
25 (read-string ";; comment")
28 (eval (read-string "(+ 2 3)"))
31 (slurp "../tests/test.txt")
34 ;;; Load the same file twice.
35 (slurp "../tests/test.txt")
40 (load-file "../tests/inc.mal")
52 (def! inc3 (fn* (a) (+ 3 a)))
81 (swap! a (fn* (a) (* 2 a)))
84 (swap! a (fn* (a b) (* a b)) 10)
90 ;; Testing swap!/closure interaction
91 (def! inc-it (fn* (a) (+ 1 a)))
93 (def! f (fn* () (swap! atm inc-it)))
99 ;; Testing whether closures can retain atoms
100 (def! g (let* (atm (atom 0)) (fn* () (deref atm))))
107 ;; -------- Deferrable Functionality --------
109 ;; Testing reading of large files
110 (load-file "../tests/computations.mal")
117 ;; Testing `@` reader macro (short for `deref`)
122 ;;; TODO: really a step5 test
123 ;; Testing that vector params not broken by TCO
127 (def! g (fn* [a] (+ a 78)))
132 ;; Testing that *ARGV* exists and is an empty list
139 ;; Testing that eval sets aa in root scope, and that it is found in nested scope
140 (let* (b 12) (do (eval (read-string "(def! aa 7)")) aa ))
146 ;; -------- Optional Functionality --------
148 ;; Testing comments in a file
149 (load-file "../tests/incB.mal")
156 ;; Testing map literal across multiple lines in a file
157 (load-file "../tests/incC.mal")
162 ;; Checking that eval does not use local environments.
165 (let* (a 2) (eval (read-string "a")))
168 ;; Non alphanumeric characters in comments in read-string
183 (read-string "1;\\\\")
185 (read-string "1;\\\\\\")
189 ;;; Hopefully less problematic characters can be checked together
190 (read-string "1; &()*+,-./:;<=>?@[]^_{|}~")