From 9e7ddacf853efd7a18c1911d2f287d483b083229 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 3 Jul 2022 00:35:32 -0400 Subject: Added a new custom type for pattern-matching macros. --- stdlib/source/test/lux.lux | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'stdlib/source/test/lux.lux') 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 .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)) -- cgit v1.2.3