Files
Nim/tests/stdlib/nre/misc.nim
flywind 98cebad7de enable style:usages for stdlib tests [backport: 1.6] (#19715)
* enable style:usages for stdlib tests

* freeAddrInfo

* more tests

* importc

* bufSize

* fix more

* => parseSql and renderSql
2022-04-13 11:53:02 +02:00

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(":") == ":::")