From 98a6e5ac3c09dd1e2300402c4be8a805fb24ce30 Mon Sep 17 00:00:00 2001 From: nitely Date: Thu, 28 Nov 2024 23:57:09 -0300 Subject: [PATCH] tests --- tests/tests2.nim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/tests2.nim b/tests/tests2.nim index 07a9a61..5c39d24 100644 --- a/tests/tests2.nim +++ b/tests/tests2.nim @@ -1495,6 +1495,10 @@ test "tfindall": @[0 .. 10, 11 .. 10, 12 .. 22, 23 .. 22] check findAllBounds("1xxx", re2"\d\w+x") == @[0 .. 3] check findAllBounds("xxxx", re2"\d\w+x").len == 0 + check findAllBounds("a123", re2"a\d*") == @[0 .. 3] + check findAllBounds("a123", re2"a\d*?") == @[0 .. 0] + check findAllBounds("a123", re2"a\d+") == @[0 .. 3] + check findAllBounds("a123", re2"a\d+?") == @[0 .. 1] test "tstarts_with": check "abc".startsWith(re2"ab") @@ -1547,6 +1551,10 @@ test "tends_with": check re2"$" in "" check endsWith("a", re2"") check re2"$" in "a" + check endsWith("a123", re2"a\d*") + #check endsWith("a123", re2"a\d*?") # XXX fix + check endsWith("a123", re2"a\d*$") + check endsWith("a123", re2"a\d*?$") test "tliterals": check "a".isMatch(re2"\u0061")