ladybird/Libraries/LibJS/Tests/Infinity-basic.js
Brian Gianforcaro bc40908d32 LibJS: Use the native assert() implementation now avaiable in 'js -t'
Switch the LibJS test suite to use the native assert implementation
surfaced inside the js repl when it's launched in test mode.
2020-04-05 15:28:45 +02:00

25 lines
764 B
JavaScript

try {
assert(Infinity + "" === "Infinity");
assert(-Infinity + "" === "-Infinity");
assert(Infinity === Infinity);
assert(Infinity - 1 === Infinity);
assert(Infinity + 1 === Infinity);
assert(-Infinity === -Infinity);
assert(-Infinity - 1 === -Infinity);
assert(-Infinity + 1 === -Infinity);
assert(1 / Infinity === 0);
assert(1 / -Infinity === 0);
assert(1 / 0 === Infinity);
assert(-1 / 0 === -Infinity);
assert(-100 < Infinity);
assert(0 < Infinity);
assert(100 < Infinity);
assert(-Infinity < Infinity);
assert(-100 > -Infinity);
assert(0 > -Infinity);
assert(100 > -Infinity);
assert(Infinity > -Infinity);
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}