Add more bool tests for and, or, not

This commit is contained in:
madmaurice 2021-04-02 16:20:15 +02:00
parent 59e7694dc0
commit 8ebb353543

View file

@ -1 +1,28 @@
(expect "True is true" t)
;; 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)))