diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/data/text/regex.lux | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/stdlib/source/test/lux/data/text/regex.lux b/stdlib/source/test/lux/data/text/regex.lux index 52053f108..ea81e2c77 100644 --- a/stdlib/source/test/lux/data/text/regex.lux +++ b/stdlib/source/test/lux/data/text/regex.lux @@ -7,17 +7,17 @@ [control pipe ["." try] - ["p" parser - ["<.>" text (#+ Parser)] - ["s" code]]] + [parser + ["<.>" text (#+ Parser)]]] [data ["." text ("#\." equivalence) ["%" format (#+ format)]]] + ["." macro + [syntax (#+ syntax:)] + ["." code]] [math [number (#+ hex)] - ["." random]] - ["." macro - [syntax (#+ syntax:)]]]] + ["." random]]]] [\\library ["." /]]) @@ -269,6 +269,15 @@ "123-456-7890"))) )) +(syntax: (expands? form) + (function (_ lux) + (#try.Success [lux (list (code.bit (case (macro.single_expansion form lux) + (#try.Success _) + true + + (#try.Failure error) + false)))]))) + (def: #export test Test (<| (_.covering /._) @@ -299,4 +308,7 @@ _ false))) + (_.cover [/.incorrect_quantification] + (and (expands? (/.regex "a{1,2}")) + (not (expands? (/.regex "a{2,1}"))))) ))) |