1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-11 13:55:55 +03:00
mal/tests/step2_eval.mal
Joel Martin f6f5d4f2a3 runtest.py: process output/errors as regex match.
Update output test data to be regex compatible.
2018-11-30 14:57:45 -06:00

45 lines
571 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
;;; This should throw an error with no return value
(abc 1 2 3)
;/.+
;; 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}