summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/Number.js
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2020-07-02 16:09:21 -0700
committerAndreas Kling <kling@serenityos.org>2020-07-03 19:30:13 +0200
commit4c48c9d69d3a949b7e434108173eee604a3235c1 (patch)
treebb574a33d977c6bf0d71f2fe6a26abb6f65cf8ff /Libraries/LibJS/Tests/Number.js
parent21064a1883d61624f4ec4069c80e0cd8aac0c1ea (diff)
downloadserenity-4c48c9d69d3a949b7e434108173eee604a3235c1.zip
LibJS: Reorganize tests into subfolders
Diffstat (limited to 'Libraries/LibJS/Tests/Number.js')
-rw-r--r--Libraries/LibJS/Tests/Number.js39
1 files changed, 0 insertions, 39 deletions
diff --git a/Libraries/LibJS/Tests/Number.js b/Libraries/LibJS/Tests/Number.js
deleted file mode 100644
index 850d41eb9a..0000000000
--- a/Libraries/LibJS/Tests/Number.js
+++ /dev/null
@@ -1,39 +0,0 @@
-load("test-common.js");
-
-try {
- assert(Number.length === 1);
- assert(Number.name === "Number");
- assert(Number.prototype.length === undefined);
-
- assert(typeof Number() === "number");
- assert(typeof new Number() === "object");
-
- assert(Number() === 0);
- assert(new Number().valueOf() === 0);
- assert(Number("42") === 42);
- assert(new Number("42").valueOf() === 42);
- assert(Number(null) === 0);
- assert(new Number(null).valueOf() === 0);
- assert(Number(true) === 1);
- assert(new Number(true).valueOf() === 1);
- assert(Number("Infinity") === Infinity);
- assert(new Number("Infinity").valueOf() === Infinity);
- assert(Number("+Infinity") === Infinity);
- assert(new Number("+Infinity").valueOf() === Infinity);
- assert(Number("-Infinity") === -Infinity);
- assert(new Number("-Infinity").valueOf() === -Infinity);
- assert(isNaN(Number(undefined)));
- assert(isNaN(new Number(undefined).valueOf()));
- assert(isNaN(Number({})));
- assert(isNaN(new Number({}).valueOf()));
- assert(isNaN(Number({a: 1})));
- assert(isNaN(new Number({a: 1}).valueOf()));
- assert(isNaN(Number([1, 2, 3])));
- assert(isNaN(new Number([1, 2, 3]).valueOf()));
- assert(isNaN(Number("foo")));
- assert(isNaN(new Number("foo").valueOf()));
-
- console.log("PASS");
-} catch (e) {
- console.log("FAIL: " + e.message);
-}