MadMaurice
c954f0216f
when and unless must not evaluate their bodies if the condition does not require it.
9 lines
247 B
Raku
9 lines
247 B
Raku
(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)))
|