Rearrange nre files
This commit is contained in:
parent
0d4aeec9be
commit
0527e1f9fe
47 changed files with 12 additions and 343 deletions
16
tests/stdlib/nre/misc.nim
Normal file
16
tests/stdlib/nre/misc.nim
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import unittest, nre, strutils, optional_nonstrict
|
||||
|
||||
suite "Misc tests":
|
||||
test "unicode":
|
||||
check("".find(re"(*UTF8)").match == "")
|
||||
check("перевірка".replace(re"(*U)\w", "") == "")
|
||||
|
||||
test "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(":") == ":::")
|
||||
Loading…
Add table
Add a link
Reference in a new issue