File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -37,5 +37,11 @@ or (a b : Bool) : Bool := a || b;
3737--- Logical conjunction.
3838and (a b : Bool) : Bool := a && b;
3939
40+ --- Logical exclusive or.
41+ xor : Bool -> Bool -> Bool
42+ | true true := false
43+ | false flase := false
44+ | _ _ := true;
45+
4046builtin assert
4147assert (x : Bool) : Bool := x;
Original file line number Diff line number Diff line change @@ -4,7 +4,15 @@ import Test.JuvixUnit open;
44import Stdlib.Prelude open;
55
66tests : List Test :=
7- [testCase "And" (assertEqual "and works as expected" (and true false) false)];
7+ [
8+ testCase "And" (assertEqual "and works as expected" (and true false) false);
9+ testCase
10+ "Xor"
11+ (assertEqual "and works as expected" (xor true false) (xor false true));
12+ testCase
13+ "Xor-2"
14+ (assertEqual "and works as expected" (xor false false) (xor true true));
15+ ];
816
917suite : TestSuite := testSuite "Prelude" tests;
1018
You can’t perform that action at this time.
0 commit comments