aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/11.14_Comma_Operator.json
diff options
context:
space:
mode:
Diffstat (limited to 'website/resources/scripts/testcases2/11.14_Comma_Operator.json')
-rw-r--r--website/resources/scripts/testcases2/11.14_Comma_Operator.json38
1 files changed, 38 insertions, 0 deletions
diff --git a/website/resources/scripts/testcases2/11.14_Comma_Operator.json b/website/resources/scripts/testcases2/11.14_Comma_Operator.json
new file mode 100644
index 000000000..6cbcf5153
--- /dev/null
+++ b/website/resources/scripts/testcases2/11.14_Comma_Operator.json
@@ -0,0 +1,38 @@
+{
+ "testCollection": {
+ "name": "11.14_Comma_Operator",
+ "numTests": 5,
+ "tests": [
+ {
+ "section": "11.14",
+ "description": "Checking by using eval",
+ "test": "//CHECK#1\nif ((eval(\"false\\u0009,\\u0009true\")) !== true) {\n $ERROR('#1: (false\\\\u0009,\\\\u0009true) === true');\n}\n\n//CHECK#2\nif ((eval(\"false\\u000B,\\u000Btrue\")) !== true) {\n $ERROR('#2: (false\\\\u000B,\\\\u000Btrue) === true'); \n}\n\n//CHECK#3\nif ((eval(\"false\\u000C,\\u000Ctrue\")) !== true) {\n $ERROR('#3: (false\\\\u000C,\\\\u000Ctrue) === true');\n}\n\n//CHECK#4\nif ((eval(\"false\\u0020,\\u0020true\")) !== true) {\n $ERROR('#4: (false\\\\u0020,\\\\u0020true) === true');\n}\n\n//CHECK#5\nif ((eval(\"false\\u00A0,\\u00A0true\")) !== true) {\n $ERROR('#5: (false\\\\u00A0,\\\\u00A0true) === true');\n}\n\n//CHECK#6\nif ((eval(\"false\\u000A,\\u000Atrue\")) !== true) {\n $ERROR('#6: (false\\\\u000A,\\\\u000Atrue) === true'); \n}\n\n//CHECK#7\nif ((eval(\"false\\u000D,\\u000Dtrue\")) !== true) {\n $ERROR('#7: (false\\\\u000D,\\\\u000Dtrue) === true');\n}\n\n//CHECK#8\nif ((eval(\"false\\u2028,\\u2028true\")) !== true) {\n $ERROR('#8: (false\\\\u2028,\\\\u2028true) === true');\n}\n\n//CHECK#9\nif ((eval(\"false\\u2029,\\u2029true\")) !== true) {\n $ERROR('#9: (false\\\\u2029,\\\\u2029true) === true');\n}\n\n\n//CHECK#10\nif ((eval(\"false\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029,\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029true\")) !== true) {\n $ERROR('#10: (false\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029,\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029true) === true');\n}\n",
+ "id": "S11.14_A1"
+ },
+ {
+ "section": "11.14",
+ "description": "Either Expression is not Reference or GetBase is not null",
+ "test": "//CHECK#1\nif ((1,2) !== 2) {\n $ERROR('#1: (1,2) === 2. Actual: ' + ((1,2)));\n}\n\n//CHECK#2\nvar x = 1;\nif ((x, 2) !== 2) {\n $ERROR('#2: var x = 1; (x, 2) === 2. Actual: ' + ((x, 2)));\n}\n\n//CHECK#3\nvar y = 2;\nif ((1, y) !== 2) {\n $ERROR('#3: var y = 2; (1, y) === 2. Actual: ' + ((1, y)));\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 2;\nif ((x, y) !== 2) {\n $ERROR('#4: var x = 1; var y = 2; (x, y) === 2. Actual: ' + ((x, y)));\n}\n\n//CHECK#5\nvar x = 1;\nif ((x, x) !== 1) {\n $ERROR('#5: var x = 1; (x, x) === 1. Actual: ' + ((x, x)));\n}\n\n//CHECK#6\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = true;\nobjecty.prop = 1.1;\nif ((objectx.prop = false, objecty.prop) !== objecty.prop) {\n $ERROR('#6: var objectx = new Object(); var objecty = new Object(); objectx.prop = true; objecty.prop = 1; (objectx.prop = false, objecty.prop) === objecty.prop. Actual: ' + ((objectx.prop = false, objecty.prop)));\n} else {\n if (objectx.prop !== false) {\n $ERROR('#6: var objectx = new Object(); var objecty = new Object(); objectx.prop = true; objecty.prop = 1; objectx.prop = false, objecty.prop; objectx.prop === false');\n } \n}\n\n",
+ "id": "S11.14_A2.1_T1"
+ },
+ {
+ "section": "11.14",
+ "description": "If GetBase(Expression) is null, throw ReferenceError",
+ "test": "//CHECK#1\ntry {\n x, 1;\n $ERROR('#1.1: x, 1 throw ReferenceError. Actual: ' + (x, 1)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x, 1 throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
+ "id": "S11.14_A2.1_T2"
+ },
+ {
+ "section": "11.14",
+ "description": "If GetBase(AssigmentExpression) is null, throw ReferenceError",
+ "test": "//CHECK#1\ntry {\n 1, y;\n $ERROR('#1.1: 1, y throw ReferenceError. Actual: ' + (1, y)); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: 1, y throw ReferenceError. Actual: ' + (e)); \n }\n}\n",
+ "id": "S11.14_A2.1_T3"
+ },
+ {
+ "section": "11.14",
+ "description": "Checking with \"=\"",
+ "test": "//CHECK#1\nvar x = 0;\nvar y = 0;\nvar z = 0;\nif ((x = 1, y = 2, z = 3) !== 3) {\n $ERROR('#1: var x = 0; var y = 0; var z = 0; (x = 1, y = 2, z = 3) === 3. Actual: ' + ((x = 1, y = 2, z = 3)));\n}\n\nvar x = 0;\nvar y = 0;\nvar z = 0;\nx = 1, y = 2, z = 3;\n\n//CHECK#2\nif (x !== 1) {\n $ERROR('#2: var x = 0; var y = 0; var z = 0; x = 1, y = 2, z = 3; x === 1. Actual: ' + (x));\n}\n\n//CHECK#3\nif (y !== 2) {\n $ERROR('#3: var x = 0; var y = 0; var z = 0; x = 1, y = 2, z = 3; y === 2. Actual: ' + (y));\n}\n\n//CHECK#4\nif (z !== 3) {\n $ERROR('#4: var x = 0; var y = 0; var z = 0; x = 1, y = 2, z = 3; z === 3. Actual: ' + (z));\n}\n",
+ "id": "S11.14_A3"
+ }
+ ]
+ }
+}