2021-04-04 01:53:18 +02:00
|
|
|
(expect "when - true condition"
|
|
|
|
(equal 'ok (when t 'ok)))
|
|
|
|
|
|
|
|
(expect "when - false condition"
|
2021-04-05 00:06:49 +02:00
|
|
|
(null (when nil 'fail)))
|
2021-04-05 04:07:22 +02:00
|
|
|
|
|
|
|
(let ((a 'ok))
|
|
|
|
(when nil (set a 'fail))
|
|
|
|
(expect "when - does not evaluate on false" (equal a 'ok)))
|
2021-04-06 23:40:10 +02:00
|
|
|
|
|
|
|
(expect "when - without body returns nil"
|
|
|
|
(null (when t)))
|
|
|
|
|
|
|
|
(expect "when - implicit progn"
|
|
|
|
(equal 'ok (when t 'wrong 'wrong2 'ok)))
|