28 lines
557 B
Raku
28 lines
557 B
Raku
;; Constants
|
|
|
|
(expect "True is true" (eq 1 (if t 1 0)))
|
|
(expect "False is false" (eq 1 (if f 0 1)))
|
|
|
|
(expect "not f == t" (not f))
|
|
(expect "not t == f" (eq 1 (if (not t) 0 1)))
|
|
|
|
;; operator and
|
|
|
|
(expect "and operator: t && t == t"
|
|
(and t t))
|
|
|
|
(expect "and operator: t && f == f"
|
|
(not (and t f)))
|
|
|
|
(expect "and operator: f && f == f"
|
|
(not (and f f)))
|
|
|
|
;; operator or
|
|
(expect "or operator: t || t == t"
|
|
(or t t))
|
|
|
|
(expect "or operator: t || f == t"
|
|
(or t f))
|
|
|
|
(expect "or operator: f || f == f"
|
|
(not (or f f)))
|