; Test that guard, or, and bool-!= work correctly together
; Basic bool-!= tests
(check (= (bool-!= 1 2) true))
(check (= (bool-!= 1 1) false))
; Basic or tests
(check (= (or true false) true))
(check (= (or false false) false))
(check (= (or false true) true))
(check (= (or true true) true))
; Varargs or
(check (= (or false false false) false))
(check (= (or false true false) true))
(check (= (or true true true) true))
; Single arg or
(check (= (or true) true))
(check (= (or false) false))
; guard with true should succeed
(check (guard true))
; Combined: guard with or and bool-!=
(check (guard (or (bool-!= 1 2))))
(check (guard (or (bool-!= 1 1) (bool-!= 2 3))))
(check (guard (or (bool-!= 1 2) (bool-!= 3 3))))
(check (guard (or (bool-!= 1 1) (bool-!= 2 1))))
(datatype Math
(Add Math Math)
(Mul Math Math)
(Val i64))
(Val 1)
(Val 2)
;; with Math eclass it still works
(check (guard (or (bool-!= (Val 1) (Val 2)) (bool-!= (Val 1) (Val 1)))))
; guard with or of all-equal should fail
(fail (check (guard (or (bool-!= 1 1)))))
(fail (check (guard (or (bool-!= 1 1) (bool-!= 2 2)))))
(fail (check (guard false)))