mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-02 03:02:31 +00:00
10 lines
378 B
Nim
10 lines
378 B
Nim
import unittest
|
|
include nre
|
|
|
|
suite "string splitting":
|
|
test "splitting strings":
|
|
check(initRegex("").split("12345") == @["1", "2", "3", "4", "5"])
|
|
check(initRegex(" ", "S").split("1 2 3 4 5 6 ") == @["1", "2", "3", "4", "5", "6", ""])
|
|
check(initRegex(" ", "S").split("1 2 ") == @["1", "", "2", "", ""])
|
|
check(initRegex(" ", "S").split("1 2") == @["1", "2"])
|