Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Mar 16, 2023
1 parent 0b3ffbd commit a64733d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/Compilation/Positive.hs
Original file line number Diff line number Diff line change
Expand Up @@ -241,5 +241,11 @@ tests =
"Simple case expression"
$(mkRelDir ".")
$(mkRelFile "test038.juvix")
$(mkRelFile "out/test038.out")
$(mkRelFile "out/test038.out"),
posTest
"Mutually recursive let expression"
$(mkRelDir ".")
$(mkRelFile "test039.juvix")
$(mkRelFile "out/test039.out")

]
2 changes: 2 additions & 0 deletions tests/Compilation/positive/out/test039.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
false
true
22 changes: 22 additions & 0 deletions tests/Compilation/positive/test039.juvix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- Mutually recursive let expressions
module test039;

open import Stdlib.Prelude;

main : IO;
main :=
let
Ty : Type;
Ty := Nat;
odd : _;
even : _;
unused : _;
odd zero := false;
odd (suc n) := not (even n);
unused := 123;
even zero := true;
even (suc n) := not (odd n);
plusOne : Ty → Ty;
plusOne n := n + 1;
in printBoolLn (odd (plusOne 13))
>> printBoolLn (even (plusOne 12));

0 comments on commit a64733d

Please sign in to comment.