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:
parent
e2fb7943f7
commit
442ef63008
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