mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-06 20:04:18 +00:00
added tests for strutils.split
This commit is contained in:
@@ -1719,3 +1719,9 @@ when isMainModule:
|
||||
doAssert isUpper("ABC")
|
||||
doAssert(not isUpper("AAcc"))
|
||||
doAssert(not isUpper("A#$"))
|
||||
|
||||
let s = " this is an example "
|
||||
doAssert s.split() == @["this", "is", "an", "example"]
|
||||
doAssert s.split(maxsplit=4) == @["this", "is", "an", "example"]
|
||||
doAssert s.split(' ', maxsplit=4) == @["", "this", "", "", "is an example "]
|
||||
doAssert s.split(" ", maxsplit=4) == @["", "this", "", "", "is an example "]
|
||||
|
||||
Reference in New Issue
Block a user