mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-27 04:37:22 +00:00
LibJS: Add the global escape() & unescape() methods
This commit is contained in:
parent
e2fb7943f7
commit
442ef63008
Notes:
sideshowbarker
2024-07-18 16:50:34 +09:00
Author: https://github.com/IdanHo
Commit: 442ef63008
Pull-request: https://github.com/SerenityOS/serenity/pull/7817
Reviewed-by: https://github.com/linusg
4 changed files with 69 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
|||
test("escape", () => {
|
||||
[
|
||||
["abc123", "abc123"],
|
||||
["äöü", "%E4%F6%FC"],
|
||||
["ć", "%u0107"],
|
||||
["@*_+-./", "@*_+-./"],
|
||||
].forEach(test => {
|
||||
expect(escape(test[0])).toBe(test[1]);
|
||||
});
|
||||
});
|
||||
|
||||
test("unescape", () => {
|
||||
[
|
||||
["abc123", "abc123"],
|
||||
["%E4%F6%FC", "äöü"],
|
||||
["%u0107", "ć"],
|
||||
["@*_+-./", "@*_+-./"],
|
||||
].forEach(test => {
|
||||
expect(unescape(test[0])).toBe(test[1]);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue