From 8ebb35354351733a41cd8058657424f08896e81b Mon Sep 17 00:00:00 2001 From: MadMaurice Date: Fri, 2 Apr 2021 16:20:15 +0200 Subject: [PATCH] Add more bool tests for and, or, not --- t/bool.t | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/t/bool.t b/t/bool.t index 4b0714c..de6b2ca 100644 --- a/t/bool.t +++ b/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)))