diff options
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/String/String.prototype.replace.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/String/String.prototype.replace.js b/Userland/Libraries/LibJS/Tests/builtins/String/String.prototype.replace.js index 16d481c9f8..90e306bccb 100644 --- a/Userland/Libraries/LibJS/Tests/builtins/String/String.prototype.replace.js +++ b/Userland/Libraries/LibJS/Tests/builtins/String/String.prototype.replace.js @@ -138,6 +138,9 @@ test("replacement with substitution", () => { expect("abc".replace(/(?<val1>a)b(?<val2>c)/, "$<val1>")).toBe("a"); expect("abc".replace(/(?<val1>a)b(?<val2>c)/, "$<val2>")).toBe("c"); expect("abc".replace(/(?<val1>a)b(?<val2>c)/, "$<val2>b$<val1>")).toBe("cba"); + + expect(/(?<𝒜>b)/u[Symbol.replace]("abc", "d$<𝒜>$`")).toBe("adbac"); + expect(/(?<$𐒤>b)/gu[Symbol.replace]("abc", "$'$<$𐒤>d")).toBe("acbdc"); }); test("replacement with substitution and 'groups' coerced to an object", () => { |