1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-20 01:57:09 +03:00
mal/tests/step2_eval.mal
Joel Martin b7b1787f83 Basic: step2 basics. Vectors and hash-maps.
Adjust step2 tests to keep values within 2 byte int range.
2016-09-10 22:13:27 -05:00

44 lines
538 B
Plaintext

;; Testing evaluation of arithmetic operations
(+ 1 2)
;=>3
(+ 5 (* 2 3))
;=>11
(- (+ 5 (* 2 3)) 3)
;=>8
(/ (- (+ 5 (* 2 3)) 3) 4)
;=>2
(/ (- (+ 515 (* 87 311)) 302) 27)
;=>1010
(* -3 6)
;=>-18
(/ (- (+ 515 (* -87 311)) 296) 27)
;=>-994
(abc 1 2 3)
; .*\'abc\' not found.*
;; Testing empty list
()
;=>()
;>>> deferrable=True
;>>> optional=True
;;
;; -------- Deferrable/Optional Functionality --------
;; Testing evaluation within collection literals
[1 2 (+ 1 2)]
;=>[1 2 3]
{"a" (+ 7 8)}
;=>{"a" 15}
{:a (+ 7 8)}
;=>{:a 15}