Minilisp.pm/t/unless.t
2021-04-09 00:01:27 +02:00

17 lines
417 B
Raku

(plan 5)
(expect "unless - true condition"
(null (unless t 'fail)))
(expect "unless - false condition"
(equal 'ok (unless nil 'ok)))
(let ((a 'ok))
(unless t (set a 'fail))
(expect "unless - does not evaluate on true" (equal a 'ok)))
(expect "unless - without body returns nil"
(null (unless nil)))
(expect "when - implicit progn"
(equal 'ok (unless nil 'wrong 'wrong2 'ok)))