Add more bool tests for and, or, not
This commit is contained in:
parent
59e7694dc0
commit
8ebb353543
1 changed files with 28 additions and 1 deletions
29
t/bool.t
29
t/bool.t
|
@ -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)))
|
||||
|
|
Loading…
Reference in a new issue