summary refs log tree commit diff stats
path: root/tests/stdlib
diff options
context:
space:
mode:
authorCarlo Capocasa <carlo@capocasa.net>2021-12-13 07:29:22 +0100
committerGitHub <noreply@github.com>2021-12-13 07:29:22 +0100
commit0ff4b2ba7ee74ed2758b0eb5992e4ccab7433952 (patch)
treeead0619e45e2af6d33dbfb9b70b20a590b29aba1 /tests/stdlib
parent4b5cecd902cc4126ff9d6cda9edb78a13a421239 (diff)
downloadNim-0ff4b2ba7ee74ed2758b0eb5992e4ccab7433952.tar.gz
fix bug #14468 zero-width split (#19248)
Diffstat (limited to 'tests/stdlib')
-rw-r--r--tests/stdlib/tre.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/stdlib/tre.nim b/tests/stdlib/tre.nim
index 2857c6c9e..9f27f7db2 100644
--- a/tests/stdlib/tre.nim
+++ b/tests/stdlib/tre.nim
@@ -108,4 +108,10 @@ proc testAll() =
     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()