mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-02 20:14:44 +00:00
fix #9437(fix re.replace wrong behaviour) (#17546)
* fix nim js cmp fails at CT * fix
This commit is contained in:
@@ -99,10 +99,13 @@ proc testAll() =
|
||||
accum.add($x)
|
||||
doAssert(accum == @["a","b","c"])
|
||||
|
||||
block:
|
||||
# bug #9306
|
||||
block: # bug #9306
|
||||
doAssert replace("bar", re"^", "foo") == "foobar"
|
||||
doAssert replace("foo", re"", "-") == "-foo"
|
||||
doAssert replace("foo", re"$", "bar") == "foobar"
|
||||
|
||||
|
||||
block: # bug #9437
|
||||
doAssert replace("foo", re"", "-") == "-f-o-o-"
|
||||
doAssert replace("ooo", re"o", "-") == "---"
|
||||
|
||||
testAll()
|
||||
|
||||
Reference in New Issue
Block a user