Skip to content

Commit

Permalink
Add more optargs cli tests
Browse files Browse the repository at this point in the history
  • Loading branch information
imaqtkatt committed Mar 6, 2024
1 parent 831eb07 commit 6888296
Show file tree
Hide file tree
Showing 36 changed files with 170 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/compile_all.args
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
compile
tests/golden_tests/cli/compile_all.hvm
-Oall
6 changes: 6 additions & 0 deletions tests/golden_tests/cli/compile_all.hvm
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))
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/compile_pre_reduce.args
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
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/compile_pre_reduce.hvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
I = (+ 2 3)

main = *
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/desugar_bool_tagged.args
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
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/desugar_bool_tagged.hvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data Boolean = True | False

main = True
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/desugar_eta.args
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
desugar
tests/golden_tests/cli/desugar_eta.hvm
-Oeta
4 changes: 4 additions & 0 deletions tests/golden_tests/cli/desugar_eta.hvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
id x = x
id2 x = (id x)

main = (id2 42)
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/desugar_float_combinators.args
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
6 changes: 6 additions & 0 deletions tests/golden_tests/cli/desugar_float_combinators.hvm
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)))
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/desugar_inline.args
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
desugar
tests/golden_tests/cli/desugar_inline.hvm
-Oinline
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/desugar_inline.hvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id x = x

main = (id id)
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/desugar_linearize_matches.args
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
1 change: 1 addition & 0 deletions tests/golden_tests/cli/desugar_linearize_matches.hvm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main = λa λb match a { 0: b; 1+: b }
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/desugar_linearize_matches_extra.args
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
1 change: 1 addition & 0 deletions tests/golden_tests/cli/desugar_linearize_matches_extra.hvm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main = λa λb λc match a { 0: b; 1+: c }
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/desugar_merge.args
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
desugar
tests/golden_tests/cli/desugar_merge.hvm
-Omerge
4 changes: 4 additions & 0 deletions tests/golden_tests/cli/desugar_merge.hvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
F = @t @f f
Z = @s @z z

main = (F)
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/desugar_prune.args
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
desugar
tests/golden_tests/cli/desugar_prune.hvm
-Oprune
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/desugar_prune.hvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id x = x

main = *
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/desugar_ref_to_ref.args
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
5 changes: 5 additions & 0 deletions tests/golden_tests/cli/desugar_ref_to_ref.hvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Foo = λ* 0

Bar = Foo

Main = (Bar *)
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/desugar_simplify_main.args
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
3 changes: 3 additions & 0 deletions tests/golden_tests/cli/desugar_simplify_main.hvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id = λx x

main = id
10 changes: 10 additions & 0 deletions tests/snapshots/cli__compile_all.hvm.snap
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))
6 changes: 6 additions & 0 deletions tests/snapshots/cli__compile_pre_reduce.hvm.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
source: tests/golden_tests.rs
input_file: tests/golden_tests/cli/compile_pre_reduce.hvm
---
@I = #5
@main = *
9 changes: 9 additions & 0 deletions tests/snapshots/cli__desugar_bool_tagged.hvm.snap
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
9 changes: 9 additions & 0 deletions tests/snapshots/cli__desugar_eta.hvm.snap
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)
13 changes: 13 additions & 0 deletions tests/snapshots/cli__desugar_float_combinators.hvm.snap
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)
7 changes: 7 additions & 0 deletions tests/snapshots/cli__desugar_inline.hvm.snap
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)
5 changes: 5 additions & 0 deletions tests/snapshots/cli__desugar_linearize_matches.hvm.snap
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 tests/snapshots/cli__desugar_linearize_matches_extra.hvm.snap
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)
7 changes: 7 additions & 0 deletions tests/snapshots/cli__desugar_merge.hvm.snap
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
5 changes: 5 additions & 0 deletions tests/snapshots/cli__desugar_prune.hvm.snap
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) = *
9 changes: 9 additions & 0 deletions tests/snapshots/cli__desugar_ref_to_ref.hvm.snap
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 *)
7 changes: 7 additions & 0 deletions tests/snapshots/cli__desugar_simplify_main.hvm.snap
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

0 comments on commit 6888296

Please sign in to comment.