aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorCalvin Rose <calsrose@gmail.com>2021-01-09 09:18:10 -0600
committerCalvin Rose <calsrose@gmail.com>2021-01-09 09:18:10 -0600
commitca92211e023b6e0d63048ea7ebb659fc2f3dae51 (patch)
tree2bc79478384d3803c2ed63f0696857c032ec00ba /test
parentAdd regex module to spork. (diff)
Add more regex character classes.
Diffstat (limited to 'test')
-rw-r--r--test/suite4.janet8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/suite4.janet b/test/suite4.janet
index 68580df..f9f37c8 100644
--- a/test/suite4.janet
+++ b/test/suite4.janet
@@ -13,4 +13,12 @@
(regex/match `(?:(abc)){4}` "abcabcabcabc"))
"match 6")
+(assert (regex/match `cat|dog` "cat") "match 6")
+(assert (regex/match `cat|dog` "dog") "match 7")
+(assert (not (regex/match `cat|dog` "mouse")) "match 8")
+(assert (regex/match `cat|dog|mouse` "mouse") "match 9")
+(assert (regex/match `cat|dog|mouse` "cat") "match 10")
+(assert (regex/match `cat|dog|mouse` "dog") "match 11")
+(assert (regex/match `(cat|dog|mouse)+` "mousecatdog") "match 12")
+
(end-suite)