mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-05 11:24:08 +00:00
Adds test case to is isMainModule block
Adds the test case that originally caused the bug, issue #2418.
This commit is contained in:
@@ -474,7 +474,12 @@ when isMainModule:
|
||||
var accum: seq[string] = @[]
|
||||
for word in split("00232this02939is39an22example111", re"\d+"):
|
||||
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):
|
||||
assert x == "d"
|
||||
|
||||
Reference in New Issue
Block a user