This commit is contained in:
Flaviu Tamas 2018-11-18 20:25:59 -05:00
commit 22b3e9df27
No known key found for this signature in database
GPG key ID: D6BF32C876496756
4 changed files with 16 additions and 12 deletions

View file

@ -16,5 +16,5 @@ suite "replace":
check("123".replace(re"(?<foo>\d)(\d)", "${foo}$#$#") == "1123")
test "replacing missing captures should throw instead of segfaulting":
discard "ab".replace(re"(a)|(b)", "$1$2")
discard "b".replace(re"(a)?(b)", "$1$2")
expect ValueError: discard "ab".replace(re"(a)|(b)", "$1$2")
expect ValueError: discard "b".replace(re"(a)?(b)", "$1$2")