diff options
Diffstat (limited to 'tests/stdlib')
-rw-r--r-- | tests/stdlib/tmarshal.nim | 2 | ||||
-rw-r--r-- | tests/stdlib/tstrutil.nim | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/stdlib/tmarshal.nim b/tests/stdlib/tmarshal.nim index 434caa281..38937590f 100644 --- a/tests/stdlib/tmarshal.nim +++ b/tests/stdlib/tmarshal.nim @@ -1,5 +1,5 @@ discard """ - output: '''{"age": 12, "bio": "\u042F Cletus", "blob": [65, 66, 67, 128], "name": "Cletus"} + output: '''{"age": 12, "bio": "Я Cletus", "blob": [65, 66, 67, 128], "name": "Cletus"} true true alpha 100 diff --git a/tests/stdlib/tstrutil.nim b/tests/stdlib/tstrutil.nim index b5e3db4e2..fef1b38c2 100644 --- a/tests/stdlib/tstrutil.nim +++ b/tests/stdlib/tstrutil.nim @@ -89,9 +89,21 @@ proc testRFind = assert "0123456789ABCDEFGAH".rfind({'A'..'C'}, 13) == 12 assert "0123456789ABCDEFGAH".rfind({'G'..'H'}, 13) == -1 +proc testCountLines = + proc assertCountLines(s: string) = assert s.countLines == s.splitLines.len + assertCountLines("") + assertCountLines("\n") + assertCountLines("\n\n") + assertCountLines("abc") + assertCountLines("abc\n123") + assertCountLines("abc\n123\n") + assertCountLines("\nabc\n123") + assertCountLines("\nabc\n123\n") + testDelete() testFind() testRFind() +testCountLines() assert(insertSep($1000_000) == "1_000_000") assert(insertSep($232) == "232") |