mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:08:13 +00:00
LibWeb: Add tests for atob() and btoa()
This commit is contained in:
parent
60599d03dd
commit
a92f7aea7a
2 changed files with 24 additions and 5 deletions
19
Libraries/LibWeb/Tests/Window/Base64.js
Normal file
19
Libraries/LibWeb/Tests/Window/Base64.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
loadPage("file:///res/html/misc/blank.html");
|
||||
|
||||
afterPageLoad(() => {
|
||||
test("atob", () => {
|
||||
expect(atob("YQ==")).toBe("a");
|
||||
expect(atob("YWE=")).toBe("aa");
|
||||
expect(atob("YWFh")).toBe("aaa");
|
||||
expect(atob("YWFhYQ==")).toBe("aaaa");
|
||||
expect(atob("/w==")).toBe("\xff");
|
||||
});
|
||||
|
||||
test("btoa", () => {
|
||||
expect(btoa("a")).toBe("YQ==");
|
||||
expect(btoa("aa")).toBe("YWE=");
|
||||
expect(btoa("aaa")).toBe("YWFh");
|
||||
expect(btoa("aaaa")).toBe("YWFhYQ==");
|
||||
expect(btoa("\xff")).toBe("/w==");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue