mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
* enable style:usages for stdlib tests * freeAddrInfo * more tests * importc * bufSize * fix more * => parseSql and renderSql
17 lines
550 B
Nim
17 lines
550 B
Nim
import unittest, nre, strutils, optional_nonstrict
|
|
|
|
block: # Misc tests
|
|
block: # unicode
|
|
check("".find(re"(*UTF8)").match == "")
|
|
check("перевірка".replace(re"(*U)\w", "") == "")
|
|
|
|
block: # empty or non-empty match
|
|
check("abc".findAll(re"|.").join(":") == ":a::b::c:")
|
|
check("abc".findAll(re".|").join(":") == "a:b:c:")
|
|
|
|
check("abc".replace(re"|.", "x") == "xxxxxxx")
|
|
check("abc".replace(re".|", "x") == "xxxx")
|
|
|
|
check("abc".split(re"|.").join(":") == ":::::")
|
|
check("abc".split(re".|").join(":") == ":::")
|