aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorEduardo Julian2016-12-19 20:01:56 -0400
committerEduardo Julian2016-12-19 20:01:56 -0400
commit98656372b3b69d6db6541538ddf7bacfd2c9a6fb (patch)
treedc23bfdf00262243c5d6fd046d837933c65854dc /stdlib
parentd81fa78b72070b05ee9575ee26c54f949f551182 (diff)
- Refactored the tests for lux/regex to avoid a truncated-class error when compiling for the JVM.
Diffstat (limited to 'stdlib')
-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")