diff --git a/tests/golden_tests/cli/compile_all.args b/tests/golden_tests/cli/compile_all.args new file mode 100644 index 000000000..8d1a454ff --- /dev/null +++ b/tests/golden_tests/cli/compile_all.args @@ -0,0 +1,3 @@ +compile +tests/golden_tests/cli/compile_all.hvm +-Oall diff --git a/tests/golden_tests/cli/compile_all.hvm b/tests/golden_tests/cli/compile_all.hvm new file mode 100644 index 000000000..39799e5be --- /dev/null +++ b/tests/golden_tests/cli/compile_all.hvm @@ -0,0 +1,6 @@ +data Pair + = (Pair fst snd) + +Pair.get f (Pair fst snd) = (f fst snd) + +main = (Pair.get @x @y (+ x y) (Pair 40 2)) diff --git a/tests/golden_tests/cli/compile_pre_reduce.args b/tests/golden_tests/cli/compile_pre_reduce.args new file mode 100644 index 000000000..8347d2f98 --- /dev/null +++ b/tests/golden_tests/cli/compile_pre_reduce.args @@ -0,0 +1,3 @@ +compile +tests/golden_tests/cli/compile_pre_reduce.hvm +-Opre-reduce diff --git a/tests/golden_tests/cli/compile_pre_reduce.hvm b/tests/golden_tests/cli/compile_pre_reduce.hvm new file mode 100644 index 000000000..1bb88cb5e --- /dev/null +++ b/tests/golden_tests/cli/compile_pre_reduce.hvm @@ -0,0 +1,3 @@ +I = (+ 2 3) + +main = * diff --git a/tests/golden_tests/cli/desugar_bool_tagged.args b/tests/golden_tests/cli/desugar_bool_tagged.args new file mode 100644 index 000000000..a4d9ed077 --- /dev/null +++ b/tests/golden_tests/cli/desugar_bool_tagged.args @@ -0,0 +1,3 @@ +desugar +tests/golden_tests/cli/desugar_bool_tagged.hvm +-Oadt-tagged-scott diff --git a/tests/golden_tests/cli/desugar_bool_tagged.hvm b/tests/golden_tests/cli/desugar_bool_tagged.hvm new file mode 100644 index 000000000..5278329e0 --- /dev/null +++ b/tests/golden_tests/cli/desugar_bool_tagged.hvm @@ -0,0 +1,3 @@ +data Boolean = True | False + +main = True diff --git a/tests/golden_tests/cli/desugar_eta.args b/tests/golden_tests/cli/desugar_eta.args new file mode 100644 index 000000000..b7547139e --- /dev/null +++ b/tests/golden_tests/cli/desugar_eta.args @@ -0,0 +1,3 @@ +desugar +tests/golden_tests/cli/desugar_eta.hvm +-Oeta diff --git a/tests/golden_tests/cli/desugar_eta.hvm b/tests/golden_tests/cli/desugar_eta.hvm new file mode 100644 index 000000000..93e6d7a1b --- /dev/null +++ b/tests/golden_tests/cli/desugar_eta.hvm @@ -0,0 +1,4 @@ +id x = x +id2 x = (id x) + +main = (id2 42) diff --git a/tests/golden_tests/cli/desugar_float_combinators.args b/tests/golden_tests/cli/desugar_float_combinators.args new file mode 100644 index 000000000..b432da5ab --- /dev/null +++ b/tests/golden_tests/cli/desugar_float_combinators.args @@ -0,0 +1,3 @@ +desugar +tests/golden_tests/cli/desugar_float_combinators.hvm +-Ofloat-combinators diff --git a/tests/golden_tests/cli/desugar_float_combinators.hvm b/tests/golden_tests/cli/desugar_float_combinators.hvm new file mode 100644 index 000000000..5af1723a7 --- /dev/null +++ b/tests/golden_tests/cli/desugar_float_combinators.hvm @@ -0,0 +1,6 @@ +Z = @s @z z +S = @x @s @z (s (x s z)) + +get = @Nat (Nat @x (+ x 1) 0) + +main = (get (S (S Z))) diff --git a/tests/golden_tests/cli/desugar_inline.args b/tests/golden_tests/cli/desugar_inline.args new file mode 100644 index 000000000..983091dda --- /dev/null +++ b/tests/golden_tests/cli/desugar_inline.args @@ -0,0 +1,3 @@ +desugar +tests/golden_tests/cli/desugar_inline.hvm +-Oinline diff --git a/tests/golden_tests/cli/desugar_inline.hvm b/tests/golden_tests/cli/desugar_inline.hvm new file mode 100644 index 000000000..6ce0570da --- /dev/null +++ b/tests/golden_tests/cli/desugar_inline.hvm @@ -0,0 +1,3 @@ +id x = x + +main = (id id) diff --git a/tests/golden_tests/cli/desugar_linearize_matches.args b/tests/golden_tests/cli/desugar_linearize_matches.args new file mode 100644 index 000000000..144ea324a --- /dev/null +++ b/tests/golden_tests/cli/desugar_linearize_matches.args @@ -0,0 +1,3 @@ +desugar +tests/golden_tests/cli/desugar_linearize_matches.hvm +-Olinearize-matches diff --git a/tests/golden_tests/cli/desugar_linearize_matches.hvm b/tests/golden_tests/cli/desugar_linearize_matches.hvm new file mode 100644 index 000000000..3980330ab --- /dev/null +++ b/tests/golden_tests/cli/desugar_linearize_matches.hvm @@ -0,0 +1 @@ +main = λa λb match a { 0: b; 1+: b } diff --git a/tests/golden_tests/cli/desugar_linearize_matches_extra.args b/tests/golden_tests/cli/desugar_linearize_matches_extra.args new file mode 100644 index 000000000..2d6822111 --- /dev/null +++ b/tests/golden_tests/cli/desugar_linearize_matches_extra.args @@ -0,0 +1,3 @@ +desugar +tests/golden_tests/cli/desugar_linearize_matches_extra.hvm +-Olinearize-matches-extra diff --git a/tests/golden_tests/cli/desugar_linearize_matches_extra.hvm b/tests/golden_tests/cli/desugar_linearize_matches_extra.hvm new file mode 100644 index 000000000..64a20adb8 --- /dev/null +++ b/tests/golden_tests/cli/desugar_linearize_matches_extra.hvm @@ -0,0 +1 @@ +main = λa λb λc match a { 0: b; 1+: c } diff --git a/tests/golden_tests/cli/desugar_merge.args b/tests/golden_tests/cli/desugar_merge.args new file mode 100644 index 000000000..698a9b365 --- /dev/null +++ b/tests/golden_tests/cli/desugar_merge.args @@ -0,0 +1,3 @@ +desugar +tests/golden_tests/cli/desugar_merge.hvm +-Omerge diff --git a/tests/golden_tests/cli/desugar_merge.hvm b/tests/golden_tests/cli/desugar_merge.hvm new file mode 100644 index 000000000..fb7c11a81 --- /dev/null +++ b/tests/golden_tests/cli/desugar_merge.hvm @@ -0,0 +1,4 @@ +F = @t @f f +Z = @s @z z + +main = (F) diff --git a/tests/golden_tests/cli/desugar_prune.args b/tests/golden_tests/cli/desugar_prune.args new file mode 100644 index 000000000..4b1dc1b4e --- /dev/null +++ b/tests/golden_tests/cli/desugar_prune.args @@ -0,0 +1,3 @@ +desugar +tests/golden_tests/cli/desugar_prune.hvm +-Oprune diff --git a/tests/golden_tests/cli/desugar_prune.hvm b/tests/golden_tests/cli/desugar_prune.hvm new file mode 100644 index 000000000..e1368b9e3 --- /dev/null +++ b/tests/golden_tests/cli/desugar_prune.hvm @@ -0,0 +1,3 @@ +id x = x + +main = * diff --git a/tests/golden_tests/cli/desugar_ref_to_ref.args b/tests/golden_tests/cli/desugar_ref_to_ref.args new file mode 100644 index 000000000..41568b563 --- /dev/null +++ b/tests/golden_tests/cli/desugar_ref_to_ref.args @@ -0,0 +1,3 @@ +desugar +tests/golden_tests/cli/desugar_ref_to_ref.hvm +-Oref-to-ref diff --git a/tests/golden_tests/cli/desugar_ref_to_ref.hvm b/tests/golden_tests/cli/desugar_ref_to_ref.hvm new file mode 100644 index 000000000..17dc21c52 --- /dev/null +++ b/tests/golden_tests/cli/desugar_ref_to_ref.hvm @@ -0,0 +1,5 @@ +Foo = λ* 0 + +Bar = Foo + +Main = (Bar *) diff --git a/tests/golden_tests/cli/desugar_simplify_main.args b/tests/golden_tests/cli/desugar_simplify_main.args new file mode 100644 index 000000000..27b9743c7 --- /dev/null +++ b/tests/golden_tests/cli/desugar_simplify_main.args @@ -0,0 +1,3 @@ +desugar +tests/golden_tests/cli/desugar_simplify_main.hvm +-Osimplify-main diff --git a/tests/golden_tests/cli/desugar_simplify_main.hvm b/tests/golden_tests/cli/desugar_simplify_main.hvm new file mode 100644 index 000000000..9d8ed665e --- /dev/null +++ b/tests/golden_tests/cli/desugar_simplify_main.hvm @@ -0,0 +1,3 @@ +id = λx x + +main = id diff --git a/tests/snapshots/cli__compile_all.hvm.snap b/tests/snapshots/cli__compile_all.hvm.snap new file mode 100644 index 000000000..e5dbf3122 --- /dev/null +++ b/tests/snapshots/cli__compile_all.hvm.snap @@ -0,0 +1,10 @@ +--- +source: tests/golden_tests.rs +input_file: tests/golden_tests/cli/compile_all.hvm +--- +@Pair = (a (b {2 {2 a {2 b c}} c})) +@Pair.get = (a ({2 @Pair.get$S0 (a b)} b)) +@Pair.get$S0 = {2 a {2 b ((a (b c)) c)}} +@main = a +& @Pair.get ~ ((<+ b c> (b c)) (d a)) +& @Pair ~ (#40 (#2 d)) diff --git a/tests/snapshots/cli__compile_pre_reduce.hvm.snap b/tests/snapshots/cli__compile_pre_reduce.hvm.snap new file mode 100644 index 000000000..b68654b6f --- /dev/null +++ b/tests/snapshots/cli__compile_pre_reduce.hvm.snap @@ -0,0 +1,6 @@ +--- +source: tests/golden_tests.rs +input_file: tests/golden_tests/cli/compile_pre_reduce.hvm +--- +@I = #5 +@main = * diff --git a/tests/snapshots/cli__desugar_bool_tagged.hvm.snap b/tests/snapshots/cli__desugar_bool_tagged.hvm.snap new file mode 100644 index 000000000..ca24321d9 --- /dev/null +++ b/tests/snapshots/cli__desugar_bool_tagged.hvm.snap @@ -0,0 +1,9 @@ +--- +source: tests/golden_tests.rs +input_file: tests/golden_tests/cli/desugar_bool_tagged.hvm +--- +(main) = True + +(False) = #Boolean λ* #Boolean λb b + +(True) = #Boolean λa #Boolean λ* a diff --git a/tests/snapshots/cli__desugar_eta.hvm.snap b/tests/snapshots/cli__desugar_eta.hvm.snap new file mode 100644 index 000000000..f45582f9b --- /dev/null +++ b/tests/snapshots/cli__desugar_eta.hvm.snap @@ -0,0 +1,9 @@ +--- +source: tests/golden_tests.rs +input_file: tests/golden_tests/cli/desugar_eta.hvm +--- +(id) = λa a + +(id2) = id + +(main) = (id2 42) diff --git a/tests/snapshots/cli__desugar_float_combinators.hvm.snap b/tests/snapshots/cli__desugar_float_combinators.hvm.snap new file mode 100644 index 000000000..bf760b87d --- /dev/null +++ b/tests/snapshots/cli__desugar_float_combinators.hvm.snap @@ -0,0 +1,13 @@ +--- +source: tests/golden_tests.rs +input_file: tests/golden_tests/cli/desugar_float_combinators.hvm +--- +(Z) = λ* λb b + +(S) = λa λb let {b b_2} = b; λc (b (a b_2 c)) + +(get) = λa (a get$S0 0) + +(main) = (get (S (S Z))) + +(get$S0) = λb (+ b 1) diff --git a/tests/snapshots/cli__desugar_inline.hvm.snap b/tests/snapshots/cli__desugar_inline.hvm.snap new file mode 100644 index 000000000..e7dc94c19 --- /dev/null +++ b/tests/snapshots/cli__desugar_inline.hvm.snap @@ -0,0 +1,7 @@ +--- +source: tests/golden_tests.rs +input_file: tests/golden_tests/cli/desugar_inline.hvm +--- +(id) = λa a + +(main) = (λa a λa a) diff --git a/tests/snapshots/cli__desugar_linearize_matches.hvm.snap b/tests/snapshots/cli__desugar_linearize_matches.hvm.snap new file mode 100644 index 000000000..571a93b11 --- /dev/null +++ b/tests/snapshots/cli__desugar_linearize_matches.hvm.snap @@ -0,0 +1,5 @@ +--- +source: tests/golden_tests.rs +input_file: tests/golden_tests/cli/desugar_linearize_matches.hvm +--- +(main) = λa λb (match a { 0: λc c; 1+: λ* λf f } b) diff --git a/tests/snapshots/cli__desugar_linearize_matches_extra.hvm.snap b/tests/snapshots/cli__desugar_linearize_matches_extra.hvm.snap new file mode 100644 index 000000000..47e449878 --- /dev/null +++ b/tests/snapshots/cli__desugar_linearize_matches_extra.hvm.snap @@ -0,0 +1,5 @@ +--- +source: tests/golden_tests.rs +input_file: tests/golden_tests/cli/desugar_linearize_matches_extra.hvm +--- +(main) = λa λb λc (match a { 0: λd λ* d; 1+: λ* λ* λi i } b c) diff --git a/tests/snapshots/cli__desugar_merge.hvm.snap b/tests/snapshots/cli__desugar_merge.hvm.snap new file mode 100644 index 000000000..1a2ab0a4e --- /dev/null +++ b/tests/snapshots/cli__desugar_merge.hvm.snap @@ -0,0 +1,7 @@ +--- +source: tests/golden_tests.rs +input_file: tests/golden_tests/cli/desugar_merge.hvm +--- +(F_$_Z) = λ* λb b + +(main) = F_$_Z diff --git a/tests/snapshots/cli__desugar_prune.hvm.snap b/tests/snapshots/cli__desugar_prune.hvm.snap new file mode 100644 index 000000000..bc2572e63 --- /dev/null +++ b/tests/snapshots/cli__desugar_prune.hvm.snap @@ -0,0 +1,5 @@ +--- +source: tests/golden_tests.rs +input_file: tests/golden_tests/cli/desugar_prune.hvm +--- +(main) = * diff --git a/tests/snapshots/cli__desugar_ref_to_ref.hvm.snap b/tests/snapshots/cli__desugar_ref_to_ref.hvm.snap new file mode 100644 index 000000000..01462e5f6 --- /dev/null +++ b/tests/snapshots/cli__desugar_ref_to_ref.hvm.snap @@ -0,0 +1,9 @@ +--- +source: tests/golden_tests.rs +input_file: tests/golden_tests/cli/desugar_ref_to_ref.hvm +--- +(Foo) = λ* 0 + +(Bar) = Foo + +(Main) = (Foo *) diff --git a/tests/snapshots/cli__desugar_simplify_main.hvm.snap b/tests/snapshots/cli__desugar_simplify_main.hvm.snap new file mode 100644 index 000000000..33d622376 --- /dev/null +++ b/tests/snapshots/cli__desugar_simplify_main.hvm.snap @@ -0,0 +1,7 @@ +--- +source: tests/golden_tests.rs +input_file: tests/golden_tests/cli/desugar_simplify_main.hvm +--- +(id) = λa a + +(main) = λa a