mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibJS: Convert most builtin tests to new system
This commit is contained in:
parent
46581773c1
commit
3f97d75778
Notes:
sideshowbarker
2024-07-19 05:04:44 +09:00
Author: https://github.com/mattco98
Commit: 3f97d75778
Pull-request: https://github.com/SerenityOS/serenity/pull/2689
Reviewed-by: https://github.com/linusg
107 changed files with 2031 additions and 2243 deletions
|
@ -1,19 +1,15 @@
|
|||
load("test-common.js");
|
||||
test("basic functionality", () => {
|
||||
expect(Math.sin).toHaveLength(1);
|
||||
|
||||
try {
|
||||
assert(Math.sin(0) === 0);
|
||||
assert(Math.sin(null) === 0);
|
||||
assert(Math.sin('') === 0);
|
||||
assert(Math.sin([]) === 0);
|
||||
assert(Math.sin(Math.PI * 3 / 2) === -1);
|
||||
assert(Math.sin(Math.PI / 2) === 1);
|
||||
assert(isNaN(Math.sin()));
|
||||
assert(isNaN(Math.sin(undefined)));
|
||||
assert(isNaN(Math.sin([1, 2, 3])));
|
||||
assert(isNaN(Math.sin({})));
|
||||
assert(isNaN(Math.sin("foo")));
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
}
|
||||
expect(Math.sin(0)).toBe(0);
|
||||
expect(Math.sin(null)).toBe(0);
|
||||
expect(Math.sin('')).toBe(0);
|
||||
expect(Math.sin([])).toBe(0);
|
||||
expect(Math.sin(Math.PI * 3 / 2)).toBe(-1);
|
||||
expect(Math.sin(Math.PI / 2)).toBe(1);
|
||||
expect(Math.sin()).toBeNaN();
|
||||
expect(Math.sin(undefined)).toBeNaN();
|
||||
expect(Math.sin([1, 2, 3])).toBeNaN();
|
||||
expect(Math.sin({})).toBeNaN();
|
||||
expect(Math.sin("foo")).toBeNaN();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue