mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +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,18 +1,12 @@
|
|||
load("test-common.js")
|
||||
test("basic functionality", () => {
|
||||
expect(Math.trunc).toHaveLength(1);
|
||||
|
||||
try {
|
||||
assert(Math.trunc(13.37) === 13);
|
||||
assert(Math.trunc(42.84) === 42);
|
||||
assert(Math.trunc(0.123) === 0);
|
||||
assert(Math.trunc(-0.123) === -0);
|
||||
expect(Math.trunc(13.37)).toBe(13);
|
||||
expect(Math.trunc(42.84)).toBe(42);
|
||||
expect(Math.trunc(0.123)).toBe( 0);
|
||||
expect(Math.trunc(-0.123)).toBe(-0);
|
||||
|
||||
assert(isNaN(Math.trunc(NaN)));
|
||||
assert(isNaN(Math.trunc('foo')));
|
||||
assert(isNaN(Math.trunc()));
|
||||
|
||||
assert(Math.trunc.length === 1);
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
}
|
||||
expect(Math.trunc(NaN)).toBeNaN();
|
||||
expect(Math.trunc('foo')).toBeNaN();
|
||||
expect(Math.trunc()).toBeNaN();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue