Adds test case to is isMainModule block

Adds the test case that originally caused the bug, issue #2418.
This commit is contained in:
Joseph Turner 2015-04-08 21:58:31 +01:00
commit 7ee6c72b51

View file

@ -474,7 +474,12 @@ when isMainModule:
var accum: seq[string] = @[] var accum: seq[string] = @[]
for word in split("00232this02939is39an22example111", re"\d+"): for word in split("00232this02939is39an22example111", re"\d+"):
accum.add(word) accum.add(word)
assert(accum == @["this", "is", "an", "example"]) assert(accum == @["", "this", "is", "an", "example", ""])
accum = @[]
for word in split("AAA : : BBB", re"\s*:\s*"):
accum.add(word)
assert(accum == @["AAA", "", "BBB"])
for x in findAll("abcdef", re"^{.}", 3): for x in findAll("abcdef", re"^{.}", 3):
assert x == "d" assert x == "d"