valeri/test/logic.vli

24 lines
606 B
Text
Raw Permalink Normal View History

;; -*- mode: lisp; -*-
(assert (= (not true) false))
(assert (= (not false) true))
(assert (and true))
(assert (= (and false) false))
(assert (and true true))
(assert (= (and true false) false))
(assert (= (and false true) false))
(assert (and true))
(assert (= (or false) false))
(assert (or true true))
(assert (or true false))
(assert (or false true))
(assert (= (or false false) false))
;; "and" is short-circuiting and should stop evaluation on first "false"
(assert (= (and false (/ 1 0)) false))
2024-08-27 22:20:01 +00:00
;; "or" is short-circuiting and should stop evaluation on first "true"
(assert (or true (/ 1 0)))