Skip to content

Commit

Permalink
Add test for parsing named function
Browse files Browse the repository at this point in the history
  • Loading branch information
7h3kk1d committed Oct 24, 2024
1 parent 01d6f3a commit 9a3b5dd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/Test_Menhir.re
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,20 @@ let tests = [
|> Exp.fresh,
"-1 + 2 - 3 / 4 * 5 ** 6 < 8" // TODO Add the remaining operators
),
test_case("named_function", `Quick, () => {
alco_check(
"named_function matches expected type",
Fun(
Pat.Var("x") |> Pat.fresh,
BinOp(Int(Plus), Var("x") |> Exp.fresh, Int(5) |> Exp.fresh)
|> Exp.fresh,
None,
Some("f"),
)
|> Exp.fresh,
Haz3lmenhir.Conversion.Exp.of_menhir_ast(
Haz3lmenhir.Interface.parse_program("named_fun f x -> x + 5"),
),
)
}),
];

0 comments on commit 9a3b5dd

Please sign in to comment.