mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 22:08:59 +00:00
The addition of assert functions to Userland/js was done before we had load(..) implemented. Now that it exists, it seems like the right move the test helper functions to pure javascript instead of poluting js with random global functions.
18 lines
451 B
JavaScript
18 lines
451 B
JavaScript
load("test-common.js");
|
|
|
|
try {
|
|
assert(Math.cos(0) === 1);
|
|
assert(Math.cos(null) === 1);
|
|
assert(Math.cos('') === 1);
|
|
assert(Math.cos([]) === 1);
|
|
assert(Math.cos(Math.PI) === -1);
|
|
assert(isNaN(Math.cos()));
|
|
assert(isNaN(Math.cos(undefined)));
|
|
assert(isNaN(Math.cos([1, 2, 3])));
|
|
assert(isNaN(Math.cos({})));
|
|
assert(isNaN(Math.cos("foo")));
|
|
|
|
console.log("PASS");
|
|
} catch (e) {
|
|
console.log("FAIL: " + e);
|
|
}
|