-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #224 from HigherOrderCO/feature/sc-496/add-cli-tes…
…ts-for-hvm-lang [sc-496] Add CLI tests for hvm-lang
- Loading branch information
Showing
49 changed files
with
249 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
compile | ||
tests/golden_tests/cli/compile_all.hvm | ||
-Oall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
compile | ||
tests/golden_tests/cli/compile_no_opts.hvm | ||
-Ono-all | ||
-Ono-eta | ||
-Ono-prune | ||
-Ono-ref-to-ref | ||
-Ono-pre-reduce | ||
-Ono-float-combinators | ||
-Ono-simplify-main | ||
-Ono-merge | ||
-Ono-inline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
main = * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
compile | ||
tests/golden_tests/cli/compile_pre_reduce.hvm | ||
-Opre-reduce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
I = (+ 2 3) | ||
|
||
main = * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
compile | ||
tests/golden_tests/cli/compile_wrong_opt.hvm | ||
-Ofoo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
main = * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
desugar | ||
tests/golden_tests/cli/desugar_bool_scott.hvm | ||
-Oadt-scott |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
data Boolean = True | False | ||
|
||
main = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
desugar | ||
tests/golden_tests/cli/desugar_bool_tagged.hvm | ||
-Oadt-tagged-scott |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
data Boolean = True | False | ||
|
||
main = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
desugar | ||
tests/golden_tests/cli/desugar_eta.hvm | ||
-Oeta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id x = x | ||
id2 x = (id x) | ||
|
||
main = (id2 42) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
desugar | ||
tests/golden_tests/cli/desugar_float_combinators.hvm | ||
-Ofloat-combinators |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
desugar | ||
tests/golden_tests/cli/desugar_inline.hvm | ||
-Oinline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
id x = x | ||
|
||
main = (id id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
desugar | ||
tests/golden_tests/cli/desugar_linearize_matches.hvm | ||
-Olinearize-matches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
main = λa λb match a { 0: b; 1+: b } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
desugar | ||
tests/golden_tests/cli/desugar_linearize_matches_extra.hvm | ||
-Olinearize-matches-extra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
main = λa λb λc match a { 0: b; 1+: c } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
desugar | ||
tests/golden_tests/cli/desugar_merge.hvm | ||
-Omerge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
F = @t @f f | ||
Z = @s @z z | ||
|
||
main = (F) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
desugar | ||
tests/golden_tests/cli/desugar_prune.hvm | ||
-Oprune |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
id x = x | ||
|
||
main = * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
desugar | ||
tests/golden_tests/cli/desugar_ref_to_ref.hvm | ||
-Oref-to-ref |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Foo = λ* 0 | ||
|
||
Bar = Foo | ||
|
||
Main = (Bar *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
desugar | ||
tests/golden_tests/cli/desugar_simplify_main.hvm | ||
-Osimplify-main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
id = λx x | ||
|
||
main = id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
run | ||
tests/golden_tests/cli/run_add.hvm | ||
3 | ||
6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
main a b = (+ a b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: tests/golden_tests.rs | ||
input_file: tests/golden_tests/cli/compile_no_opts.hvm | ||
--- | ||
@main = * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
source: tests/golden_tests.rs | ||
input_file: tests/golden_tests/cli/compile_pre_reduce.hvm | ||
--- | ||
Warnings: | ||
Unused definition 'I'. | ||
|
||
@I = #5 | ||
@main = * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
source: tests/golden_tests.rs | ||
input_file: tests/golden_tests/cli/compile_wrong_opt.hvm | ||
--- | ||
error: invalid value 'foo' for '-O <COMP_OPTS>' | ||
[possible values: all, no-all, eta, no-eta, prune, no-prune, ref-to-ref, no-ref-to-ref, pre-reduce, no-pre-reduce, linearize-matches, linearize-matches-extra, no-linearize-matches, float-combinators, no-float-combinators, simplify-main, no-simplify-main, merge, no-merge, inline, no-inline, adt-scott, adt-tagged-scott] | ||
|
||
tip: a similar value exists: 'float-combinators' | ||
|
||
For more information, try '--help'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
source: tests/golden_tests.rs | ||
input_file: tests/golden_tests/cli/desugar_bool_scott.hvm | ||
--- | ||
(main) = True | ||
|
||
(False) = λ* λb b | ||
|
||
(True) = λa λ* a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
5 changes: 5 additions & 0 deletions
5
tests/snapshots/cli__desugar_linearize_matches_extra.hvm.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: tests/golden_tests.rs | ||
input_file: tests/golden_tests/cli/desugar_prune.hvm | ||
--- | ||
(main) = * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: tests/golden_tests.rs | ||
input_file: tests/golden_tests/cli/run_add.hvm | ||
--- | ||
9 |