diff options
author | Eduardo Julian | 2022-07-03 00:35:32 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-07-03 00:35:32 -0400 |
commit | 9e7ddacf853efd7a18c1911d2f287d483b083229 (patch) | |
tree | 140eee091b7453879f072a48044635d03aa5096b /stdlib/source/test/lux.lux | |
parent | 7e4c9ba2e02f06fa621ffe24bc0ca046536429ef (diff) |
Added a new custom type for pattern-matching macros.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux.lux | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index 1452a1aed..a857eee53 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -173,7 +173,7 @@ (all _.and (_.coverage [/.list] (case (/.list e/0 e/1) - (pattern (/.list a/0 a/1)) + (/.list a/0 a/1) (and (n.= e/0 a/0) (n.= e/1 a/1)) @@ -550,7 +550,7 @@ (same? /.Nat (/.type_of expected))) (_.coverage [/.Primitive] (case (/.Primitive "foo" [expected/0 expected/1]) - (pattern {.#Primitive "foo" (list actual/0 actual/1)}) + {.#Primitive "foo" (list actual/0 actual/1)} (and (same? expected/0 actual/0) (same? expected/1 actual/1)) @@ -681,8 +681,8 @@ (all _.and (_.coverage [/.static] (case sample - (pattern (/.static option/0)) true - (pattern (/.static option/1)) true + (/.static option/0) true + (/.static option/1) true _ false)) (_.coverage [/.char] (|> (`` (/.char (,, (/.static static_char)))) @@ -982,10 +982,13 @@ {.#Right +0} true _ false) )) - (_.coverage [/.pattern] - (/.case [..#left expected_nat ..#right expected_int] - (/.pattern (!pair 0 +0)) true - _ false)) + ... (_.coverage [/.pattern] + ... (/.case [..#left expected_nat ..#right expected_int] + ... (!pair 0 +0) + ... true + + ... _ + ... false)) (_.coverage [/.let] (and (/.let [actual_nat expected_nat] (/.same? expected_nat actual_nat)) @@ -1105,7 +1108,7 @@ let/3 <code>.local]) (in (list (code.bit (case (the .#scopes lux_state) - (pattern (list.partial scope/2 _)) + (list.partial scope/2 _) (let [locals/2 (the .#locals scope/2) expected_locals/2 (set.of_list text.hash (list fn/2 var/2 let/2 let/3)) |