1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:47:34 +00:00

LibJS: Add the global escape() & unescape() methods

This commit is contained in:
Idan Horowitz 2021-06-05 19:21:15 +03:00 committed by Linus Groh
parent e2fb7943f7
commit 442ef63008
4 changed files with 69 additions and 0 deletions

View file

@ -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]);
});
});