Minilisp.pm/t/math.t

17 lines
398 B
Perl
Raw Normal View History

2021-04-02 19:03:37 +02:00
(expect "add" (= (+ 2 4 2) 8))
(expect "sub" (= (- 8 2 3) 3))
(expect "mul" (= (* 5 6) 30))
(expect "div" (= (/ 64 4) 16))
(expect "2 is even" (evenp 2))
(expect "3 is not even" (not (evenp 3)))
(expect "5 is odd" (oddp 5))
(expect "6 is not odd" (not (oddp 6)))
(expect "0 is 0" (zerop 0))
(expect "1 is not 0" (not (zerop 1)))
(expect "max" (= (max 5 30) 30))
(expect "min" (= (min 5 30) 5))