From 85c5c45fb7ed18f9d9e60c0473d49d2ea630560b Mon Sep 17 00:00:00 2001 From: imaqtkatt Date: Tue, 12 Mar 2024 16:21:44 -0300 Subject: [PATCH] Add debug flag cli test --- tests/golden_tests/cli/debug_u60_to_nat.args | 4 +++ tests/golden_tests/cli/debug_u60_to_nat.hvm | 6 ++++ .../snapshots/cli__debug_u60_to_nat.hvm.snap | 33 +++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 tests/golden_tests/cli/debug_u60_to_nat.args create mode 100644 tests/golden_tests/cli/debug_u60_to_nat.hvm create mode 100644 tests/snapshots/cli__debug_u60_to_nat.hvm.snap diff --git a/tests/golden_tests/cli/debug_u60_to_nat.args b/tests/golden_tests/cli/debug_u60_to_nat.args new file mode 100644 index 000000000..0dc92ddd0 --- /dev/null +++ b/tests/golden_tests/cli/debug_u60_to_nat.args @@ -0,0 +1,4 @@ +run +tests/golden_tests/cli/debug_u60_to_nat.hvm +-d +4 diff --git a/tests/golden_tests/cli/debug_u60_to_nat.hvm b/tests/golden_tests/cli/debug_u60_to_nat.hvm new file mode 100644 index 000000000..066ca8c8d --- /dev/null +++ b/tests/golden_tests/cli/debug_u60_to_nat.hvm @@ -0,0 +1,6 @@ +data Nat = (Z) | (S nat) + +(U60ToNat 0) = Z +(U60ToNat 1+p) = (S (U60ToNat p)) + +(Main n) = (U60ToNat n) diff --git a/tests/snapshots/cli__debug_u60_to_nat.hvm.snap b/tests/snapshots/cli__debug_u60_to_nat.hvm.snap new file mode 100644 index 000000000..fa90a4051 --- /dev/null +++ b/tests/snapshots/cli__debug_u60_to_nat.hvm.snap @@ -0,0 +1,33 @@ +--- +source: tests/golden_tests.rs +input_file: tests/golden_tests/cli/debug_u60_to_nat.hvm +--- +(λa (U60ToNat a) 4) +--------------------------------------- +(U60ToNat 4) +--------------------------------------- +(λa (S (U60ToNat a)) 3) +--------------------------------------- +(S (U60ToNat 3)) +--------------------------------------- +(S (λa (S (U60ToNat a)) 2)) +--------------------------------------- +(S (S (U60ToNat 2))) +--------------------------------------- +(S (S (λa (S (U60ToNat a)) 1))) +--------------------------------------- +(S (S (S (U60ToNat 1)))) +--------------------------------------- +(S (S (S (λa (S (U60ToNat a)) 0)))) +--------------------------------------- +(S (S (S (S (U60ToNat 0))))) +--------------------------------------- +(S (S (S (S Z)))) +--------------------------------------- +(S (S (S #Nat λ* #Nat λa #Nat (a Z)))) +--------------------------------------- +(S (S #Nat λ* #Nat λa #Nat (a #Nat λ* #Nat λb #Nat (b Z)))) +--------------------------------------- +(S #Nat λ* #Nat λa #Nat (a #Nat λ* #Nat λb #Nat (b #Nat λ* #Nat λc #Nat (c Z)))) +--------------------------------------- +(S (S (S (S Z))))