mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
LibJS: Convert most builtin tests to new system
This commit is contained in:
parent
46581773c1
commit
3f97d75778
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