Skip to content

Commit 98a6e5a

Browse files
committed
tests
1 parent 17f5541 commit 98a6e5a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/tests2.nim

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,6 +1495,10 @@ test "tfindall":
14951495
@[0 .. 10, 11 .. 10, 12 .. 22, 23 .. 22]
14961496
check findAllBounds("1xxx", re2"\d\w+x") == @[0 .. 3]
14971497
check findAllBounds("xxxx", re2"\d\w+x").len == 0
1498+
check findAllBounds("a123", re2"a\d*") == @[0 .. 3]
1499+
check findAllBounds("a123", re2"a\d*?") == @[0 .. 0]
1500+
check findAllBounds("a123", re2"a\d+") == @[0 .. 3]
1501+
check findAllBounds("a123", re2"a\d+?") == @[0 .. 1]
14981502

14991503
test "tstarts_with":
15001504
check "abc".startsWith(re2"ab")
@@ -1547,6 +1551,10 @@ test "tends_with":
15471551
check re2"$" in ""
15481552
check endsWith("a", re2"")
15491553
check re2"$" in "a"
1554+
check endsWith("a123", re2"a\d*")
1555+
#check endsWith("a123", re2"a\d*?") # XXX fix
1556+
check endsWith("a123", re2"a\d*$")
1557+
check endsWith("a123", re2"a\d*?$")
15501558

15511559
test "tliterals":
15521560
check "a".isMatch(re2"\u0061")

0 commit comments

Comments
 (0)