1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 16:24:59 +00:00
serenity/Libraries/LibJS/Tests/NaN-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

16 lines
430 B
JavaScript

try {
var nan = undefined + 1;
assert(nan + "" == "NaN");
assert(NaN + "" == "NaN");
assert(nan !== nan);
assert(NaN !== NaN);
assert(isNaN(nan) === true);
assert(isNaN(NaN) === true);
assert(isNaN(0) === false);
assert(isNaN(undefined) === true);
assert(isNaN(null) === false);
assert(isNaN(Infinity) === false);
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}