summaryrefslogtreecommitdiff
path: root/lib/regex/test/basic.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-05-19 22:41:05 -0700
committerOri Bernstein <ori@eigenstate.org>2016-05-19 22:41:05 -0700
commitc3a7db11052192c3ae599604e0c3922a28a7f771 (patch)
treeca274cbb208662159690f613dc4a8438a6a0c4b8 /lib/regex/test/basic.myr
parent009cb9bf1139d5ddda4e464734f53eeb4ec10d74 (diff)
downloadmc-c3a7db11052192c3ae599604e0c3922a28a7f771.tar.gz
Add tracing of steps when in debug mode.
Diffstat (limited to 'lib/regex/test/basic.myr')
-rw-r--r--lib/regex/test/basic.myr10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/regex/test/basic.myr b/lib/regex/test/basic.myr
index 35109c9..506b7c0 100644
--- a/lib/regex/test/basic.myr
+++ b/lib/regex/test/basic.myr
@@ -19,21 +19,29 @@ const main = {
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
][:], "")
+ std.put("hi\n")
testmatch(".*bc", "Abc", `std.Some [][:])
- testmatch("(a*)*", "a", `std.Some ["a"][:])
+ std.put("1\n")
+ dbgmatch("(a*)*", "a", `std.Some ["a"][:])
+ std.put("2\n")
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>",
][:])
+ std.put("6\n")
}