aboutsummaryrefslogtreecommitdiff
path: root/test/text.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-03 22:56:53 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-03 22:56:53 -0400
commit850fc8fbe1a777b12170ac90460b22afc10e9ad0 (patch)
tree0b3dc20e29ca38c7770a48234857364107fbd6fe /test/text.tm
parent79b48365d6abe0f42b9cadd01959eeb1fa1be0b8 (diff)
Clean up text replacement API to use backrefs instead of match_chain()
Diffstat (limited to 'test/text.tm')
-rw-r--r--test/text.tm6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/text.tm b/test/text.tm
index d75a56a7..950805a9 100644
--- a/test/text.tm
+++ b/test/text.tm
@@ -227,11 +227,11 @@ func main():
>> $/$malicious/
= $/{1{}xxx}/
- >> "Hello":replace($/{lower}/, "(@)", $/@/)
+ >> "Hello":replace($/{lower}/, "(\0)")
= "H(ello)"
- >> " foo(xyz) foo(yyy) foo(z()) ":replace_chain([$/foo(/, $/?/, $/)/], ["baz[", "@", "]"], $/@/)
- = " baz[xyz] baz[yyy] baz[z()] "
+ >> " foo(xyz) foo(yyy) foo(z()) ":replace($/foo(?)/, "baz(\1)")
+ = " baz(xyz) baz(yyy) baz(z()) "
>> "<tag>":replace_all({$/</:"&lt;", $/>/:"&gt;"})
= "&lt;tag&gt;"