MadMaurice
c954f0216f
when and unless must not evaluate their bodies if the condition does not require it.
9 lines
238 B
Raku
9 lines
238 B
Raku
(expect "when - true condition"
|
|
(equal 'ok (when t 'ok)))
|
|
|
|
(expect "when - false condition"
|
|
(null (when nil 'fail)))
|
|
|
|
(let ((a 'ok))
|
|
(when nil (set a 'fail))
|
|
(expect "when - does not evaluate on false" (equal a 'ok)))
|