mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
Libraries: Move to Userland/Libraries/
This commit is contained in:
parent
dc28c07fa5
commit
13d7c09125
Notes:
sideshowbarker
2024-07-18 23:53:55 +09:00
Author: https://github.com/awesomekling
Commit: 13d7c09125
1857 changed files with 266 additions and 274 deletions
|
@ -1,36 +0,0 @@
|
|||
function isPositiveZero(value) {
|
||||
return value === 0 && 1 / value === Infinity;
|
||||
}
|
||||
|
||||
function isNegativeZero(value) {
|
||||
return value === 0 && 1 / value === -Infinity;
|
||||
}
|
||||
|
||||
test("basic functionality", () => {
|
||||
expect(Math.sign).toHaveLength(1);
|
||||
|
||||
expect(Math.sign(0.0001)).toBe(1);
|
||||
expect(Math.sign(1)).toBe(1);
|
||||
expect(Math.sign(42)).toBe(1);
|
||||
expect(Math.sign(Infinity)).toBe(1);
|
||||
expect(isPositiveZero(Math.sign(0))).toBeTrue();
|
||||
expect(isPositiveZero(Math.sign(null))).toBeTrue();
|
||||
expect(isPositiveZero(Math.sign(""))).toBeTrue();
|
||||
expect(isPositiveZero(Math.sign([]))).toBeTrue();
|
||||
|
||||
expect(Math.sign(-0.0001)).toBe(-1);
|
||||
expect(Math.sign(-1)).toBe(-1);
|
||||
expect(Math.sign(-42)).toBe(-1);
|
||||
expect(Math.sign(-Infinity)).toBe(-1);
|
||||
expect(isNegativeZero(Math.sign(-0))).toBeTrue();
|
||||
expect(isNegativeZero(Math.sign(-null))).toBeTrue();
|
||||
expect(isNegativeZero(Math.sign(-""))).toBeTrue();
|
||||
expect(isNegativeZero(Math.sign(-[]))).toBeTrue();
|
||||
|
||||
expect(Math.sign()).toBeNaN();
|
||||
expect(Math.sign(undefined)).toBeNaN();
|
||||
expect(Math.sign([1, 2, 3])).toBeNaN();
|
||||
expect(Math.sign({})).toBeNaN();
|
||||
expect(Math.sign(NaN)).toBeNaN();
|
||||
expect(Math.sign("foo")).toBeNaN();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue