summaryrefslogtreecommitdiff
path: root/lib/regex/test/basic.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-05-23 14:17:36 -0700
committerOri Bernstein <ori@eigenstate.org>2016-05-23 14:17:36 -0700
commit167228d8551ba8b4dc282489258ad2e50363a56f (patch)
tree27c8d6257bfc63bb9d6523d96ee282309259deba /lib/regex/test/basic.myr
parent31247e29fb596b44fdd5c18140bc945b6a4b71ce (diff)
downloadmc-167228d8551ba8b4dc282489258ad2e50363a56f.tar.gz
add substitution for full matches.
Diffstat (limited to 'lib/regex/test/basic.myr')
-rw-r--r--lib/regex/test/basic.myr9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/regex/test/basic.myr b/lib/regex/test/basic.myr
index 506b7c0..9506a90 100644
--- a/lib/regex/test/basic.myr
+++ b/lib/regex/test/basic.myr
@@ -19,27 +19,20 @@ const main = {
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
][:], "")
- std.put("hi\n")
testmatch(".*bc", "Abc", `std.Some [][:])
- std.put("1\n")
- dbgmatch("(a*)*", "a", `std.Some ["a"][:])
- std.put("2\n")
+ testmatch("(a*)*", "a", `std.Some ["a"][:])
testmatch("(aa|aab?)*", s, `std.Some ["aa"][:])
- std.put("3\n")
/* greedy matches */
testmatch("(<.*>).*", "<a foo> blah <bar>", `std.Some [
"<a foo> blah <bar>",
][:])
- std.put("3\n")
testmatch("(<.+>).*", "<a foo> blah <bar>", `std.Some [
"<a foo> blah <bar>",
][:])
- std.put("4\n")
/* reluctant matches */
testmatch("(<.*?>).*", "<a foo> blah <bar>", `std.Some [
"<a foo>",
][:])
- std.put("5\n")
testmatch("(<.+?>).*", "<a foo> blah <bar>", `std.Some [
"<a foo>",
][:])