mirror of
https://github.com/kanaka/mal.git
synced 2024-11-11 00:52:44 +03:00
b7b1787f83
Adjust step2 tests to keep values within 2 byte int range.
44 lines
538 B
Plaintext
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}
|