aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/test/test/lux/regex.lux16
1 files changed, 11 insertions, 5 deletions
diff --git a/stdlib/test/test/lux/regex.lux b/stdlib/test/test/lux/regex.lux
index e8ff5f8cf..b2a2b71b1 100644
--- a/stdlib/test/test/lux/regex.lux
+++ b/stdlib/test/test/lux/regex.lux
@@ -90,7 +90,7 @@
(should-fail (&;regex "\\W") "a")))
))
-(test: "Regular Expressions [Special system character classes]"
+(test: "Regular Expressions [Special system character classes : Part 1]"
($_ seq
(assert "Can parse using special character classes."
(and (and (should-pass (&;regex "\\p{Lower}") "m")
@@ -110,8 +110,13 @@
(and (should-pass (&;regex "\\p{Space}") " ")
(should-fail (&;regex "\\p{Space}") "."))
+ ))
+ ))
- (and (should-pass (&;regex "\\p{HexDigit}") "a")
+(test: "Regular Expressions [Special system character classes : Part 2]"
+ ($_ seq
+ (assert "Can parse using special character classes."
+ (and (and (should-pass (&;regex "\\p{HexDigit}") "a")
(should-fail (&;regex "\\p{HexDigit}") "."))
(and (should-pass (&;regex "\\p{OctDigit}") "6")
@@ -133,7 +138,8 @@
(should-fail (&;regex "\\p{Graph}") " "))
(and (should-pass (&;regex "\\p{Print}") "\u0020")
- (should-fail (&;regex "\\p{Print}") "\u1234"))))
+ (should-fail (&;regex "\\p{Print}") "\u1234"))
+ ))
))
(test: "Regular Expressions [Custom character classes : Part 1]"
@@ -201,11 +207,11 @@
(assert "Can match patterns optionally."
(and (should-passT "a" (&;regex "a?") "a")
(should-passT "" (&;regex "a?") "")))
-
+
(assert "Can match a pattern 0 or more times."
(and (should-passT "aaa" (&;regex "a*") "aaa")
(should-passT "" (&;regex "a*") "")))
-
+
(assert "Can match a pattern 1 or more times."
(and (should-passT "aaa" (&;regex "a+") "aaa")
(should-passT "a" (&;regex "a+") "a")