Skip to content

Commit

Permalink
add snehole tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoly1219 committed Feb 19, 2024
1 parent 6f99825 commit 79c4a21
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/Test_syn.re
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,22 @@ let test_shole_2 = () => {
check(htyp_typ, "same option(Hazelnut.Htyp.t)", given, expected);
};

let test_snehole_1 = () => {
let ctx: typctx = TypCtx.empty;
let he: Hazelnut.Hexp.t = NEHole(EHole);
let given: option(Hazelnut.Htyp.t) = Hazelnut.syn(ctx, he);
let expected: option(Hazelnut.Htyp.t) = Some(Hazelnut.Htyp.Hole);
check(htyp_typ, "same option(Hazelnut.Htyp.t)", given, expected);
};

let test_snehole_2 = () => {
let ctx: typctx = TypCtx.singleton("incr", Hazelnut.Htyp.Arrow(Num, Num));
let he: Hazelnut.Hexp.t = NEHole(Asc(Ap(Var("incr"), Lit(1)), Num));
let given: option(Hazelnut.Htyp.t) = Hazelnut.syn(ctx, he);
let expected: option(Hazelnut.Htyp.t) = Some(Hazelnut.Htyp.Hole);
check(htyp_typ, "same option(Hazelnut.Htyp.t)", given, expected);
};

let syn_tests = [
("test_sasc_1", `Quick, test_sasc_1),
("test_sasc_2", `Quick, test_sasc_2),
Expand All @@ -119,4 +135,6 @@ let syn_tests = [
("test_splus_2", `Quick, test_splus_2),
("test_shole_1", `Quick, test_shole_1),
("test_shole_2", `Quick, test_shole_2),
("test_snehole_1", `Quick, test_snehole_1),
("test_snehole_2", `Quick, test_snehole_2),
];

0 comments on commit 79c4a21

Please sign in to comment.