summaryrefslogtreecommitdiff
path: root/libregex/test/boundaries.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-06-15 02:02:23 -0700
committerOri Bernstein <ori@eigenstate.org>2015-06-15 02:02:23 -0700
commit49ea47caf3cb37e0fe667d3ed833d12d670bae68 (patch)
tree2e4e9104e0597f3f2a8b95558363db9fc23a9722 /libregex/test/boundaries.myr
parentc2a04cf2cb447ffb3c24d91e7978ef170460bf46 (diff)
downloadmc-49ea47caf3cb37e0fe667d3ed833d12d670bae68.tar.gz
Update libregex tests to run in mbld.
Drop the hacky shell.
Diffstat (limited to 'libregex/test/boundaries.myr')
-rw-r--r--libregex/test/boundaries.myr39
1 files changed, 29 insertions, 10 deletions
diff --git a/libregex/test/boundaries.myr b/libregex/test/boundaries.myr
index 03157e4..196d197 100644
--- a/libregex/test/boundaries.myr
+++ b/libregex/test/boundaries.myr
@@ -1,17 +1,36 @@
+use std
use "testmatch.use"
const main = {
/* expected matches */
- testmatch("\\<([a-z]*)\\>", "abcdef") /* whole word */
- testmatch(".*(\\<.*\\>).*", "!m!") /* single char word in midstring */
- testmatch(".*(\\<.*\\>).*", "!m") /* single char word at end of string */
- testmatch(".*(\\<.*\\>).*", "m!") /* single char word at start of string */
- testmatch(".*(\\<.*\\>).*", "!@#!!matches!!%!") /* word in midstring */
- testmatch(".*(\\<.*\\>).*", "matches!!%!") /* word at start of string */
- testmatch(".*(\\<.*\\>).*", "!@#!!matches") /* word at end of string */
- testmatch(".*(\\<.*\\>).*", "!@#!!matches!!%!foo") /* matches last word in string */
- testmatch(".*(\\<.*\\>).*", "123") /* numbers are also word bounds */
+ testmatch("\\<([a-z]*)\\>", "abcdef", `std.Some [
+ "abcdef",
+ ][:])
+ testmatch(".*(\\<.*\\>).*", "!m!", `std.Some [ /* single char word in midstring */
+ "m",
+ ][:])
+ testmatch(".*(\\<.*\\>).*", "!m", `std.Some [ /* single char word at end of string */
+ "m",
+ ][:])
+ testmatch(".*(\\<.*\\>).*", "m!", `std.Some [ /* single char word at start of string */
+ "m",
+ ][:])
+ testmatch(".*(\\<.*\\>).*", "!@#!!matches!!%!", `std.Some [ /* word in midstring */
+ "matches",
+ ][:])
+ testmatch(".*(\\<.*\\>).*", "matches!!%!", `std.Some [ /* word at start of string */
+ "matches",
+ ][:])
+ testmatch(".*(\\<.*\\>).*", "!@#!!matches", `std.Some [ /* word at end of string */
+ "matches",
+ ][:])
+ testmatch(".*(\\<.*\\>).*", "!@#!!matches!!%!foo", `std.Some [ /* matches last word in string */
+ "foo",
+ ][:])
+ testmatch(".*(\\<.*\\>).*", "123", `std.Some [ /* numbers are also word bounds */
+ "123",
+ ][:])
/* nonmatches */
- testmatch("\\<([a-z]*)\\>foo", "abcdefoo") /* word boundary needed in midstring */
+ testmatch("\\<([a-z]*)\\>foo", "abcdefoo", `std.None) /* word boundary needed in midstring */
}