fix bug #14468 zero-width split (#19248) (#19269)

This commit is contained in:
Carlo Capocasa
2021-12-20 13:10:51 +01:00
committed by GitHub
parent d4de5d32bc
commit f2e7e5d899
2 changed files with 13 additions and 4 deletions

View File

@@ -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()