1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 20:25:07 +00:00
serenity/Libraries/LibJS/Tests/Math.max.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

12 lines
282 B
JavaScript

try {
assert(Math.max.length === 2);
assert(Math.max(1) === 1);
assert(Math.max(2, 1) === 2);
assert(Math.max(1, 2, 3) === 3);
assert(isNaN(Math.max(NaN)));
assert(isNaN(Math.max("String", 1)));
console.log("PASS");
} catch {
console.log("FAIL");
}