aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/15.7.1_The_Number_Constructor_Called_as_a_Function.json
diff options
context:
space:
mode:
Diffstat (limited to 'website/resources/scripts/testcases2/15.7.1_The_Number_Constructor_Called_as_a_Function.json')
-rw-r--r--website/resources/scripts/testcases2/15.7.1_The_Number_Constructor_Called_as_a_Function.json20
1 files changed, 20 insertions, 0 deletions
diff --git a/website/resources/scripts/testcases2/15.7.1_The_Number_Constructor_Called_as_a_Function.json b/website/resources/scripts/testcases2/15.7.1_The_Number_Constructor_Called_as_a_Function.json
new file mode 100644
index 000000000..14481b2ac
--- /dev/null
+++ b/website/resources/scripts/testcases2/15.7.1_The_Number_Constructor_Called_as_a_Function.json
@@ -0,0 +1,20 @@
+{
+ "testCollection": {
+ "name": "15.7.1_The_Number_Constructor_Called_as_a_Function",
+ "numTests": 2,
+ "tests": [
+ {
+ "section": "15.7.1.1",
+ "description": "Used values \"10\", 10, new String(\"10\"), new Object(10) and \"abc\"",
+ "test": "//CHECK#1\nif( typeof Number(\"10\") !== \"number\" ) {\n $ERROR('#1: typeof Number(\"10\") should be \"number\", actual is \"'+typeof Number(\"10\")+'\"');\n}\n\n//CHECK#2\nif( typeof Number(10) !== \"number\" ) {\n $ERROR('#2: typeof Number(10) should be \"number\", actual is \"'+typeof Number(10)+'\"');\n}\n\n//CHECK#3\nif( typeof Number(new String(\"10\")) !== \"number\" ) {\n $ERROR('#3: typeof Number(new String(\"10\")) should be \"number\", actual is \"'+typeof Number(new String(\"10\"))+'\"');\n}\n\n//CHECK#4\nif( typeof Number(new Object(10)) !== \"number\" ) {\n $ERROR('#4: typeof Number(new Object(10)) should be \"number\", actual is \"'+typeof Number(new Object(10))+'\"');\n}\n\n//CHECK #5\nif( typeof Number(\"abc\") !== \"number\" ) {\n $ERROR('#5: typeof Number(\"abc\") should be \"number\", actual is \"'+typeof Number(\"abc\")+'\"');\n}\n\n//CHECK #6\nif( !isNaN(Number(\"abc\"))) {\n\t$ERROR('#6: Number(\"abc\")) should be NaN');\n}\n",
+ "id": "S15.7.1.1_A1"
+ },
+ {
+ "section": "15.7.1.1",
+ "description": "Call Number() and check result",
+ "test": "//CHECK#1\nif( typeof Number() !== \"number\" ) {\n $ERROR('#1: typeof Number() should be \"number\", actual is \"'+typeof Number()+'\"');\n}\n\n//CHECK#2\nif( Number() !== 0 ) {\n $ERROR('#2: Number() === 0, actual is '+Number());\n} else if( 1/Number() !== Number.POSITIVE_INFINITY ) {\n $ERROR('#2: Number() === +0, actual is '+Number());\n}\n\n",
+ "id": "S15.7.1.1_A2"
+ }
+ ]
+ }
+}