
The addition of assert functions to Userland/js was done before we had load(..) implemented. Now that it exists, it seems like the right move the test helper functions to pure javascript instead of poluting js with random global functions.
14 lines
307 B
JavaScript
14 lines
307 B
JavaScript
load("test-common.js");
|
|
|
|
try {
|
|
assert(Math.min.length === 2);
|
|
assert(Math.min(1) === 1);
|
|
assert(Math.min(2, 1) === 1);
|
|
assert(Math.min(1, 2, 3) === 1);
|
|
assert(isNaN(Math.min(NaN)));
|
|
assert(isNaN(Math.min("String", 1)));
|
|
|
|
console.log("PASS");
|
|
} catch {
|
|
console.log("FAIL");
|
|
}
|