2020-04-13 14:31:13 -03:00
|
|
|
load("test-common.js");
|
|
|
|
|
|
2020-03-29 09:56:28 -03:00
|
|
|
try {
|
|
|
|
|
assert(Math.abs('-1') === 1);
|
2020-04-02 13:58:39 -03:00
|
|
|
assert(Math.abs(-2) === 2);
|
2020-03-29 09:56:28 -03:00
|
|
|
assert(Math.abs(null) === 0);
|
|
|
|
|
assert(Math.abs('') === 0);
|
|
|
|
|
assert(Math.abs([]) === 0);
|
|
|
|
|
assert(Math.abs([2]) === 2);
|
|
|
|
|
assert(isNaN(Math.abs([1, 2])));
|
|
|
|
|
assert(isNaN(Math.abs({})));
|
|
|
|
|
assert(isNaN(Math.abs('string')));
|
|
|
|
|
assert(isNaN(Math.abs()));
|
|
|
|
|
console.log("PASS");
|
|
|
|
|
} catch {
|
|
|
|
|
}
|