diff options
Diffstat (limited to 'stdlib/source/test/lux/data/text/regex.lux')
-rw-r--r-- | stdlib/source/test/lux/data/text/regex.lux | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/stdlib/source/test/lux/data/text/regex.lux b/stdlib/source/test/lux/data/text/regex.lux index b77909f5a..554a47eff 100644 --- a/stdlib/source/test/lux/data/text/regex.lux +++ b/stdlib/source/test/lux/data/text/regex.lux @@ -26,7 +26,7 @@ (-> (Parser Text) Text Bit) (|> input (<text>.result regex) - (case> (#try.Success parsed) + (case> {#try.Success parsed} (text\= parsed input) _ @@ -36,7 +36,7 @@ (-> Text (Parser Text) Text Bit) (|> input (<text>.result regex) - (case> (#try.Success parsed) + (case> {#try.Success parsed} (text\= test parsed) _ @@ -46,7 +46,7 @@ (All (_ a) (-> (Parser a) Text Bit)) (|> input (<text>.result regex) - (case> (#try.Failure _) + (case> {#try.Failure _} true _ @@ -58,7 +58,7 @@ (macro.with_identifiers [g!message g!_] (in (list (` (|> (~ input) (<text>.result (~ regex)) - (case> (^ (#try.Success (~ pattern))) + (case> (^ {#try.Success (~ pattern)}) true (~ g!_) @@ -259,27 +259,27 @@ Test ($_ _.and (_.test "Can specify alternative patterns." - (and (should_check ["a" (0 #0 [])] (/.regex "a|b") "a") - (should_check ["b" (0 #1 [])] (/.regex "a|b") "b") + (and (should_check ["a" {0 #0 []}] (/.regex "a|b") "a") + (should_check ["b" {0 #1 []}] (/.regex "a|b") "b") (should_fail (/.regex "a|b") "c"))) (_.test "Can have groups within alternations." - (and (should_check ["abc" (0 #0 ["b" "c"])] (/.regex "a(.)(.)|b(.)(.)") "abc") - (should_check ["bcd" (0 #1 ["c" "d"])] (/.regex "a(.)(.)|b(.)(.)") "bcd") + (and (should_check ["abc" {0 #0 ["b" "c"]}] (/.regex "a(.)(.)|b(.)(.)") "abc") + (should_check ["bcd" {0 #1 ["c" "d"]}] (/.regex "a(.)(.)|b(.)(.)") "bcd") (should_fail (/.regex "a(.)(.)|b(.)(.)") "cde") - (should_check ["123-456-7890" (0 #0 ["123" "456-7890" "456" "7890"])] + (should_check ["123-456-7890" {0 #0 ["123" "456-7890" "456" "7890"]}] (/.regex "(\d{3})-((\d{3})-(\d{4}))|b(.)d") "123-456-7890"))) )) (syntax: (expands? [form <code>.any]) (function (_ lux) - (#try.Success [lux (list (code.bit (case (macro.single_expansion form lux) - (#try.Success _) + {#try.Success [lux (list (code.bit (case (macro.single_expansion form lux) + {#try.Success _} true - (#try.Failure error) - false)))]))) + {#try.Failure error} + false)))]})) (def: .public test Test |