summary refs log tree commit diff stats
path: root/tests/stdlib/tre.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib/tre.nim')
-rw-r--r--tests/stdlib/tre.nim20
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/stdlib/tre.nim b/tests/stdlib/tre.nim
index ea1b5af32..39637434d 100644
--- a/tests/stdlib/tre.nim
+++ b/tests/stdlib/tre.nim
@@ -1,4 +1,9 @@
+discard """
+  matrix: "--mm:refc; --mm:orc"
+"""
+
 import std/re
+import std/assertions
 
 proc testAll() =
   doAssert match("(a b c)", rex"\( .* \)")
@@ -99,10 +104,19 @@ proc testAll() =
       accum.add($x)
     doAssert(accum == @["a","b","c"])
 
-  block:
-    # bug #9306
+  block: # bug #9306
     doAssert replace("bar", re"^", "foo") == "foobar"
-    doAssert replace("foo", re"", "-") == "-foo"
     doAssert replace("foo", re"$", "bar") == "foobar"
 
+
+  block: # bug #9437
+    doAssert replace("foo", re"", "-") == "-f-o-o-"
+    doAssert replace("ooo", re"o", "-") == "---"
+
+  block: # bug #14468
+    accum = @[]
+    for word in split("this is an example", re"\b"):
+      accum.add(word)
+    doAssert(accum == @["this", " ", "is", " ", "an", " ", "example"])
+
 testAll()