aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/11.5.3_Applying_the_percent_Operator.json
diff options
context:
space:
mode:
Diffstat (limited to 'website/resources/scripts/testcases2/11.5.3_Applying_the_percent_Operator.json')
-rw-r--r--website/resources/scripts/testcases2/11.5.3_Applying_the_percent_Operator.json194
1 files changed, 194 insertions, 0 deletions
diff --git a/website/resources/scripts/testcases2/11.5.3_Applying_the_percent_Operator.json b/website/resources/scripts/testcases2/11.5.3_Applying_the_percent_Operator.json
new file mode 100644
index 000000000..47cb56c13
--- /dev/null
+++ b/website/resources/scripts/testcases2/11.5.3_Applying_the_percent_Operator.json
@@ -0,0 +1,194 @@
+{
+ "testCollection": {
+ "name": "11.5.3_Applying_the_percent_Operator",
+ "numTests": 31,
+ "tests": [
+ {
+ "section": "11.5.3, 7.2, 7.3",
+ "description": "Checking by using eval",
+ "test": "//CHECK#1\nif (eval(\"1\\u0009%\\u00091\") !== 0) {\n $ERROR('#1: 1\\\\u0009%\\\\u00091 === 0');\n}\n\n//CHECK#2\nif (eval(\"1\\u000B%\\u000B1\") !== 0) {\n $ERROR('#2: 1\\\\u000B%\\\\u000B1 === 0'); \n}\n\n//CHECK#3\nif (eval(\"1\\u000C%\\u000C1\") !== 0) {\n $ERROR('#3: 1\\\\u000C%\\\\u000C1 === 0');\n}\n\n//CHECK#4\nif (eval(\"1\\u0020%\\u00201\") !== 0) {\n $ERROR('#4: 1\\\\u0020%\\\\u00201 === 0');\n}\n\n//CHECK#5\nif (eval(\"1\\u00A0%\\u00A01\") !== 0) {\n $ERROR('#5: 1\\\\u00A0%\\\\u00A01 === 0');\n}\n\n//CHECK#6\nif (eval(\"1\\u000A%\\u000A1\") !== 0) {\n $ERROR('#6: 1\\\\u000A%\\\\u000A1 === 0'); \n}\n\n//CHECK#7\nif (eval(\"1\\u000D%\\u000D1\") !== 0) {\n $ERROR('#7: 1\\\\u000D%\\\\u000D1 === 0');\n}\n\n//CHECK#8\nif (eval(\"1\\u2028%\\u20281\") !== 0) {\n $ERROR('#8: 1\\\\u2028%\\\\u20281 === 0');\n}\n\n//CHECK#9\nif (eval(\"1\\u2029%\\u20291\") !== 0) {\n $ERROR('#9: 1\\\\u2029%\\\\u20291 === 0');\n}\n\n//CHECK#10\nif (eval(\"1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029%\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\") !== 0) {\n $ERROR('#10: 1\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u2029%\\\\u0009\\\\u000B\\\\u000C\\\\u0020\\\\u00A0\\\\u000A\\\\u000D\\\\u2028\\\\u20291 === 0');\n}\n",
+ "id": "S11.5.3_A1"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Either Type is not Reference or GetBase is not null",
+ "test": "//CHECK#1\nif (1 % 2 !== 1) {\n $ERROR('#1: 1 % 2 === 1. Actual: ' + (1 % 2));\n}\n\n//CHECK#2\nvar x = 1;\nif (x % 2 !== 1) {\n $ERROR('#2: var x = 1; x % 2 === 1. Actual: ' + (x % 2));\n}\n\n//CHECK#3\nvar y = 2;\nif (1 % y !== 1) {\n $ERROR('#3: var y = 2; 1 % y === 1. Actual: ' + (1 % y));\n}\n\n//CHECK#4\nvar x = 1;\nvar y = 2;\nif (x % y !== 1) {\n $ERROR('#4: var x = 1; var y = 2; x % y === 1. Actual: ' + (x % y));\n}\n\n//CHECK#5\nvar objectx = new Object();\nvar objecty = new Object();\nobjectx.prop = 1;\nobjecty.prop = 2;\nif (objectx.prop % objecty.prop !== 1) {\n $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 2; objectx.prop % objecty.prop === 1. Actual: ' + (objectx.prop % objecty.prop));\n}\n",
+ "id": "S11.5.3_A2.1_T1"
+ },
+ {
+ "section": "11.5.3",
+ "description": "If GetBase(x) 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\n",
+ "id": "S11.5.3_A2.1_T2"
+ },
+ {
+ "section": "11.5.3",
+ "description": "If GetBase(y) 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.5.3_A2.1_T3"
+ },
+ {
+ "section": "11.5.3, 8.6.2.6",
+ "description": "If Type(value) is Object, evaluate ToPrimitive(value, Number)",
+ "test": "//CHECK#1\nif ({valueOf: function() {return 1}} % 2 !== 1) {\n $ERROR('#1: {valueOf: function() {return 1}} % 2 === 1. Actual: ' + ({valueOf: function() {return 1}} % 2));\n}\n\n//CHECK#2\nif ({valueOf: function() {return 1}, toString: function() {return 0}} % 2 !== 1) {\n $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 0}} % 2 === 1. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 0}} % 2));\n}\n\n//CHECK#3\nif ({valueOf: function() {return 1}, toString: function() {return {}}} % 2 !== 1) {\n $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} % 2 === 1. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} % 2));\n}\n\n//CHECK#4\ntry {\n if ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} % 2 !== 1) {\n $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} % 2 === 1. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw \"error\"}} % 2));\n }\n}\ncatch (e) {\n if (e === \"error\") {\n $ERROR('#4.2: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} % 2 not throw \"error\"');\n } else {\n $ERROR('#4.3: {valueOf: function() {return 1}, toString: function() {throw \"error\"}} % 2 not throw Error. Actual: ' + (e));\n }\n}\n\n//CHECK#5\nif (1 % {toString: function() {return 2}} !== 1) {\n $ERROR('#5: 1 % {toString: function() {return 2}} === 1. Actual: ' + (1 % {toString: function() {return 2}}));\n}\n\n//CHECK#6\nif (1 % {valueOf: function() {return {}}, toString: function() {return 2}} !== 1) {\n $ERROR('#6: 1 % {valueOf: function() {return {}}, toString: function() {return 2}} === 1. Actual: ' + (1 % {valueOf: function() {return {}}, toString: function() {return 2}}));\n}\n\n//CHECK#7\ntry {\n 1 % {valueOf: function() {throw \"error\"}, toString: function() {return 2}};\n $ERROR('#7.1: 1 % {valueOf: function() {throw \"error\"}, toString: function() {return 2}} throw \"error\". Actual: ' + (1 % {valueOf: function() {throw \"error\"}, toString: function() {return 2}}));\n} \ncatch (e) {\n if (e !== \"error\") {\n $ERROR('#7.2: 1 % {valueOf: function() {throw \"error\"}, toString: function() {return 2}} throw \"error\". Actual: ' + (e));\n } \n}\n\n//CHECK#8\ntry {\n 1 % {valueOf: function() {return {}}, toString: function() {return {}}};\n $ERROR('#8.1: 1 % {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 % {valueOf: function() {return {}}, toString: function() {return {}}}));\n} \ncatch (e) {\n if ((e instanceof TypeError) !== true) {\n $ERROR('#8.2: 1 % {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));\n } \n}\n",
+ "id": "S11.5.3_A2.2_T1"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Checking with \"throw\"",
+ "test": "//CHECK#1\nvar x = { valueOf: function () { throw \"x\"; } };\nvar y = { valueOf: function () { throw \"y\"; } };\ntry {\n x % y;\n $ERROR('#1.1: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x % y throw \"x\". Actual: ' + (x % y));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: ToNumber(first expression) is called first, and then ToNumber(second expression)');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = { valueOf: function () { throw \"x\"; } }; var y = { valueOf: function () { throw \"y\"; } }; x % y throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
+ "id": "S11.5.3_A2.3_T1"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Checking with \"=\"",
+ "test": "//CHECK#1\nvar x = 0; \nif ((x = 1) % x !== 0) {\n $ERROR('#1: var x = 0; (x = 1) % x === 0. Actual: ' + ((x = 1) % x));\n}\n\n//CHECK#2\nvar x = 1; \nif (x % (x = 2) !== 1) {\n $ERROR('#2: var x = 1; x % (x = 2) === 1. Actual: ' + (x % (x = 2)));\n}\n\n",
+ "id": "S11.5.3_A2.4_T1"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Checking with \"throw\"",
+ "test": "//CHECK#1\nvar x = function () { throw \"x\"; };\nvar y = function () { throw \"y\"; };\ntry {\n x() % y();\n $ERROR('#1.1: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() % y() throw \"x\". Actual: ' + (x() % y()));\n} catch (e) {\n if (e === \"y\") {\n $ERROR('#1.2: First expression is evaluated first, and then second expression');\n } else {\n if (e !== \"x\") {\n $ERROR('#1.3: var x = function () { throw \"x\"; }; var y = function () { throw \"y\"; }; x() % y() throw \"x\". Actual: ' + (e));\n }\n }\n}\n",
+ "id": "S11.5.3_A2.4_T2"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Checking with undeclarated variables",
+ "test": "//CHECK#1\ntry {\n x % (x = 1);\n $ERROR('#1.1: x % (x = 1) throw ReferenceError. Actual: ' + (x % (x = 1))); \n}\ncatch (e) {\n if ((e instanceof ReferenceError) !== true) {\n $ERROR('#1.2: x % (x = 1) throw ReferenceError. Actual: ' + (e)); \n }\n}\n\n//CHECK#2\nif ((y = 1) % y !== 0) {\n $ERROR('#2: (y = 1) % y === 0. Actual: ' + ((y = 1) % y));\n}\n\n",
+ "id": "S11.5.3_A2.4_T3"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Type(x) and Type(y) vary between primitive boolean and Boolean object",
+ "test": "//CHECK#1\nif (true % true !== 0) {\n $ERROR('#1: true % true === 0. Actual: ' + (true % true));\n}\n\n//CHECK#2\nif (new Boolean(true) % true !== 0) {\n $ERROR('#2: new Boolean(true) % true === 0. Actual: ' + (new Boolean(true) % true));\n}\n\n//CHECK#3\nif (true % new Boolean(true) !== 0) {\n $ERROR('#3: true % new Boolean(true) === 0. Actual: ' + (true % new Boolean(true)));\n}\n\n//CHECK#4\nif (new Boolean(true) % new Boolean(true) !== 0) {\n $ERROR('#4: new Boolean(true) % new Boolean(true) === 0. Actual: ' + (new Boolean(true) % new Boolean(true)));\n}\n",
+ "id": "S11.5.3_A3_T1.1"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Type(x) and Type(y) vary between primitive number and Number object",
+ "test": "//CHECK#1\nif (1 % 1 !== 0) {\n $ERROR('#1: 1 % 1 === 0. Actual: ' + (1 % 1));\n}\n\n//CHECK#2\nif (new Number(1) % 1 !== 0) {\n $ERROR('#2: new Number(1) % 1 === 0. Actual: ' + (new Number(1) % 1));\n}\n\n//CHECK#3\nif (1 % new Number(1) !== 0) {\n $ERROR('#3: 1 % new Number(1) === 0. Actual: ' + (1 % new Number(1)));\n}\n\n//CHECK#4\nif (new Number(1) % new Number(1) !== 0) {\n $ERROR('#4: new Number(1) % new Number(1) === 0. Actual: ' + (new Number(1) % new Number(1)));\n}\n\n",
+ "id": "S11.5.3_A3_T1.2"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Type(x) and Type(y) vary between primitive string and String object",
+ "test": "//CHECK#1\nif (\"1\" % \"1\" !== 0) {\n $ERROR('#1: \"1\" % \"1\" === 0. Actual: ' + (\"1\" % \"1\"));\n}\n\n//CHECK#2\nif (new String(\"1\") % \"1\" !== 0) {\n $ERROR('#2: new String(\"1\") % \"1\" === 0. Actual: ' + (new String(\"1\") % \"1\"));\n}\n\n//CHECK#3\nif (\"1\" % new String(\"1\") !== 0) {\n $ERROR('#3: \"1\" % new String(\"1\") === 0. Actual: ' + (\"1\" % new String(\"1\")));\n}\n\n//CHECK#4\nif (new String(\"1\") % new String(\"1\") !== 0) {\n $ERROR('#4: new String(\"1\") % new String(\"1\") === 0. Actual: ' + (new String(\"1\") % new String(\"1\")));\n}\n\n//CHECK#5\nif (isNaN(\"x\" % \"1\") !== true) {\n $ERROR('#5: \"x\" % \"1\" === Not-a-Number. Actual: ' + (\"x\" % \"1\"));\n}\n\n//CHECK#6\nif (isNaN(\"1\" % \"x\") !== true) {\n $ERROR('#6: \"1\" % \"x\" === Not-a-Number. Actual: ' + (\"1\" % \"x\"));\n}\n",
+ "id": "S11.5.3_A3_T1.3"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Type(x) and Type(y) vary between Null and Undefined",
+ "test": "//CHECK#1\nif (isNaN(null % undefined) !== true) {\n $ERROR('#1: null % undefined === Not-a-Number. Actual: ' + (null % undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined % null) !== true) {\n $ERROR('#2: undefined % null === Not-a-Number. Actual: ' + (undefined % null));\n}\n\n//CHECK#3\nif (isNaN(undefined % undefined) !== true) {\n $ERROR('#3: undefined % undefined === Not-a-Number. Actual: ' + (undefined % undefined));\n}\n\n//CHECK#4\nif (isNaN(null % null) !== true) {\n $ERROR('#4: null % null === Not-a-Number. Actual: ' + (null % null));\n}\n",
+ "id": "S11.5.3_A3_T1.4"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Type(x) and Type(y) vary between Object object and Function object",
+ "test": "//CHECK#1\nif (isNaN({} % function(){return 1}) !== true) {\n $ERROR('#1: {} % function(){return 1} === Not-a-Number. Actual: ' + ({} % function(){return 1}));\n}\n\n//CHECK#2\nif (isNaN(function(){return 1} % {}) !== true) {\n $ERROR('#2: function(){return 1} % {} === Not-a-Number. Actual: ' + (function(){return 1} % {}));\n}\n\n//CHECK#3\nif (isNaN(function(){return 1} % function(){return 1}) !== true) {\n $ERROR('#3: function(){return 1} % function(){return 1} === Not-a-Number. Actual: ' + (function(){return 1} % function(){return 1}));\n}\n\n//CHECK#4\nif (isNaN({} % {}) !== true) {\n $ERROR('#4: {} % {} === Not-a-Number. Actual: ' + ({} % {}));\n}\n",
+ "id": "S11.5.3_A3_T1.5"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Boolean (primitive and object)",
+ "test": "//CHECK#1\nif (true % 1 !== 0) {\n $ERROR('#1: true % 1 === 0. Actual: ' + (true % 1));\n}\n\n//CHECK#2\nif (1 % true !== 0) {\n $ERROR('#2: 1 % true === 0. Actual: ' + (1 % true));\n}\n\n//CHECK#3\nif (new Boolean(true) % 1 !== 0) {\n $ERROR('#3: new Boolean(true) % 1 === 0. Actual: ' + (new Boolean(true) % 1));\n}\n\n//CHECK#4\nif (1 % new Boolean(true) !== 0) {\n $ERROR('#4: 1 % new Boolean(true) === 0. Actual: ' + (1 % new Boolean(true)));\n}\n\n//CHECK#5\nif (true % new Number(1) !== 0) {\n $ERROR('#5: true % new Number(1) === 0. Actual: ' + (true % new Number(1)));\n}\n\n//CHECK#6\nif (new Number(1) % true !== 0) {\n $ERROR('#6: new Number(1) % true === 0. Actual: ' + (new Number(1) % true));\n}\n\n//CHECK#7\nif (new Boolean(true) % new Number(1) !== 0) {\n $ERROR('#7: new Boolean(true) % new Number(1) === 0. Actual: ' + (new Boolean(true) % new Number(1)));\n}\n\n//CHECK#8\nif (new Number(1) % new Boolean(true) !== 0) {\n $ERROR('#8: new Number(1) % new Boolean(true) === 0. Actual: ' + (new Number(1) % new Boolean(true)));\n}\n",
+ "id": "S11.5.3_A3_T2.1"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and String (primitive and object)",
+ "test": "//CHECK#1\nif (\"1\" % 1 !== 0) {\n $ERROR('#1: \"1\" % 1 === 0. Actual: ' + (\"1\" % 1));\n}\n\n//CHECK#2\nif (1 % \"1\" !== 0) {\n $ERROR('#2: 1 % \"1\" === 0. Actual: ' + (1 % \"1\"));\n}\n\n//CHECK#3\nif (new String(\"1\") % 1 !== 0) {\n $ERROR('#3: new String(\"1\") % 1 === 0. Actual: ' + (new String(\"1\") % 1));\n}\n\n//CHECK#4\nif (1 % new String(\"1\") !== 0) {\n $ERROR('#4: 1 % new String(\"1\") === 0. Actual: ' + (1 % new String(\"1\")));\n}\n\n//CHECK#5\nif (\"1\" % new Number(1) !== 0) {\n $ERROR('#5: \"1\" % new Number(1) === 0. Actual: ' + (\"1\" % new Number(1)));\n}\n\n//CHECK#6\nif (new Number(1) % \"1\" !== 0) {\n $ERROR('#6: new Number(1) % \"1\" === 0. Actual: ' + (new Number(1) % \"1\"));\n}\n\n//CHECK#7\nif (new String(\"1\") % new Number(1) !== 0) {\n $ERROR('#7: new String(\"1\") % new Number(1) === 0. Actual: ' + (new String(\"1\") % new Number(1)));\n}\n\n//CHECK#8\nif (new Number(1) % new String(\"1\") !== 0) {\n $ERROR('#8: new Number(1) % new String(\"1\") === 0. Actual: ' + (new Number(1) % new String(\"1\")));\n}\n\n//CHECK#9\nif (isNaN(\"x\" % 1) !== true) {\n $ERROR('#9: \"x\" % 1 === Not-a-Number. Actual: ' + (\"x\" % 1));\n}\n\n//CHECK#10\nif (isNaN(1 % \"x\") !== true) {\n $ERROR('#10: 1 % \"x\" === Not-a-Number. Actual: ' + (1 % \"x\"));\n}\n",
+ "id": "S11.5.3_A3_T2.2"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Null",
+ "test": "//CHECK#1\nif (isNaN(1 % null) !== true) {\n $ERROR('#1: 1 % null === Not-a-Number. Actual: ' + (1 % null));\n}\n\n//CHECK#2\nif (null % 1 !== 0) {\n $ERROR('#2: null % 1 === 0. Actual: ' + (null % 1));\n}\n\n//CHECK#3\nif (isNaN(new Number(1) % null) !== true) {\n $ERROR('#3: new Number(1) % null === Not-a-Number. Actual: ' + (new Number(1) % null));\n}\n\n//CHECK#4\nif (null % new Number(1) !== 0) {\n $ERROR('#4: null % new Number(1) === 0. Actual: ' + (null % new Number(1)));\n}\n",
+ "id": "S11.5.3_A3_T2.3"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Undefined",
+ "test": "//CHECK#1\nif (isNaN(1 % undefined) !== true) {\n $ERROR('#1: 1 % undefined === Not-a-Number. Actual: ' + (1 % undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined % 1) !== true) {\n $ERROR('#2: undefined % 1 === Not-a-Number. Actual: ' + (undefined % 1));\n}\n\n//CHECK#3\nif (isNaN(new Number(1) % undefined) !== true) {\n $ERROR('#3: new Number(1) % undefined === Not-a-Number. Actual: ' + (new Number(1) % undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined % new Number(1)) !== true) {\n $ERROR('#4: undefined % new Number(1) === Not-a-Number. Actual: ' + (undefined % new Number(1)));\n}\n",
+ "id": "S11.5.3_A3_T2.4"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Boolean (primitive and object)",
+ "test": "//CHECK#1\nif (true % \"1\" !== 0) {\n $ERROR('#1: true % \"1\" === 0. Actual: ' + (true % \"1\"));\n}\n\n//CHECK#2\nif (\"1\" % true !== 0) {\n $ERROR('#2: \"1\" % true === 0. Actual: ' + (\"1\" % true));\n}\n\n//CHECK#3\nif (new Boolean(true) % \"1\" !== 0) {\n $ERROR('#3: new Boolean(true) % \"1\" === 0. Actual: ' + (new Boolean(true) % \"1\"));\n}\n\n//CHECK#4\nif (\"1\" % new Boolean(true) !== 0) {\n $ERROR('#4: \"1\" % new Boolean(true) === 0. Actual: ' + (\"1\" % new Boolean(true)));\n}\n\n//CHECK#5\nif (true % new String(\"1\") !== 0) {\n $ERROR('#5: true % new String(\"1\") === 0. Actual: ' + (true % new String(\"1\")));\n}\n\n//CHECK#6\nif (new String(\"1\") % true !== 0) {\n $ERROR('#6: new String(\"1\") % true === 0. Actual: ' + (new String(\"1\") % true));\n}\n\n//CHECK#7\nif (new Boolean(true) % new String(\"1\") !== 0) {\n $ERROR('#7: new Boolean(true) % new String(\"1\") === 0. Actual: ' + (new Boolean(true) % new String(\"1\")));\n}\n\n//CHECK#8\nif (new String(\"1\") % new Boolean(true) !== 0) {\n $ERROR('#8: new String(\"1\") % new Boolean(true) === 0. Actual: ' + (new String(\"1\") % new Boolean(true)));\n}\n",
+ "id": "S11.5.3_A3_T2.5"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Undefined",
+ "test": "//CHECK#1\nif (isNaN(\"1\" % undefined) !== true) {\n $ERROR('#1: \"1\" % undefined === Not-a-Number. Actual: ' + (\"1\" % undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined % \"1\") !== true) {\n $ERROR('#2: undefined % \"1\" === Not-a-Number. Actual: ' + (undefined % \"1\"));\n}\n\n//CHECK#3\nif (isNaN(new String(\"1\") % undefined) !== true) {\n $ERROR('#3: new String(\"1\") % undefined === Not-a-Number. Actual: ' + (new String(\"1\") % undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined % new String(\"1\")) !== true) {\n $ERROR('#4: undefined % new String(\"1\") === Not-a-Number. Actual: ' + (undefined % new String(\"1\")));\n}\n",
+ "id": "S11.5.3_A3_T2.6"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Type(x) is different from Type(y) and both types vary between String (primitive or object) and Null",
+ "test": "//CHECK#1\nif (isNaN(\"1\" % null) !== true) {\n $ERROR('#1: \"1\" % null === Not-a-Number. Actual: ' + (\"1\" % null));\n}\n\n//CHECK#2\nif (null % \"1\" !== 0) {\n $ERROR('#2: null % \"1\" === 0. Actual: ' + (null % \"1\"));\n}\n\n//CHECK#3\nif (isNaN(new String(\"1\") % null) !== true) {\n $ERROR('#3: new String(\"1\") % null === Not-a-Number. Actual: ' + (new String(\"1\") % null));\n}\n\n//CHECK#4\nif (null % new String(\"1\") !== 0) {\n $ERROR('#4: null % new String(\"1\") === 0. Actual: ' + (null % new String(\"1\")));\n}\n",
+ "id": "S11.5.3_A3_T2.7"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Undefined",
+ "test": "//CHECK#1\nif (isNaN(true % undefined) !== true) {\n $ERROR('#1: true % undefined === Not-a-Number. Actual: ' + (true % undefined));\n}\n\n//CHECK#2\nif (isNaN(undefined % true) !== true) {\n $ERROR('#2: undefined % true === Not-a-Number. Actual: ' + (undefined % true));\n}\n\n//CHECK#3\nif (isNaN(new Boolean(true) % undefined) !== true) {\n $ERROR('#3: new Boolean(true) % undefined === Not-a-Number. Actual: ' + (new Boolean(true) % undefined));\n}\n\n//CHECK#4\nif (isNaN(undefined % new Boolean(true)) !== true) {\n $ERROR('#4: undefined % new Boolean(true) === Not-a-Number. Actual: ' + (undefined % new Boolean(true)));\n}\n",
+ "id": "S11.5.3_A3_T2.8"
+ },
+ {
+ "section": "11.5.3",
+ "description": "Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Null",
+ "test": "//CHECK#1\nif (isNaN(true % null) !== true) {\n $ERROR('#1: true % null === Not-a-Number. Actual: ' + (true % null));\n}\n\n//CHECK#2\nif (null % true !== 0) {\n $ERROR('#2: null % true === 0. Actual: ' + (null % true));\n}\n\n//CHECK#3\nif (isNaN(new Boolean(true) % null) !== true) {\n $ERROR('#3: new Boolean(true) % null === Not-a-Number. Actual: ' + (new Boolean(true) % null));\n}\n\n//CHECK#4\nif (null % new Boolean(true) !== 0) {\n $ERROR('#4: null % new Boolean(true) === 0. Actual: ' + (null % new Boolean(true)));\n}\n",
+ "id": "S11.5.3_A3_T2.9"
+ },
+ {
+ "section": "11.5.3",
+ "description": "If either operand is NaN, the result is NaN",
+ "test": "//CHECK#1\nif (isNaN(Number.NaN % Number.NaN) !== true) {\n $ERROR('#1: NaN % NaN === Not-a-Number. Actual: ' + (NaN % NaN));\n} \n\n//CHECK#2\nif (isNaN(Number.NaN % +0) !== true) {\n $ERROR('#2: NaN % +0 === Not-a-Number. Actual: ' + (NaN % +0)); \n} \n\n//CHECK#3\nif (isNaN(Number.NaN % -0) !== true) {\n $ERROR('#3: NaN % -0 === Not-a-Number. Actual: ' + (NaN % -0)); \n} \n\n//CHECK#4\nif (isNaN(Number.NaN % Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#4: NaN % Infinity === Not-a-Number. Actual: ' + (NaN % Infinity));\n} \n\n//CHECK#5\nif (isNaN(Number.NaN % Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#5: NaN % -Infinity === Not-a-Number. Actual: ' + (NaN % -Infinity)); \n} \n\n//CHECK#6\nif (isNaN(Number.NaN % Number.MAX_VALUE) !== true) {\n $ERROR('#6: NaN % Number.MAX_VALUE === Not-a-Number. Actual: ' + (NaN % Number.MAX_VALUE));\n} \n\n//CHECK#7\nif (isNaN(Number.NaN % Number.MIN_VALUE) !== true) {\n $ERROR('#7: NaN % Number.MIN_VALUE === Not-a-Number. Actual: ' + (NaN % Number.MIN_VALUE)); \n}\n\n//CHECK#8\nif (isNaN(Number.NaN % 1) !== true) {\n $ERROR('#8: NaN % 1 === Not-a-Number. Actual: ' + (NaN % 1)); \n}\n",
+ "id": "S11.5.3_A4_T1.1"
+ },
+ {
+ "section": "11.5.3",
+ "description": "If either operand is NaN, the result is NaN",
+ "test": "//CHECK#1\nif (isNaN(Number.NaN % Number.NaN) !== true) {\n $ERROR('#1: NaN % NaN === Not-a-Number. Actual: ' + (NaN % NaN));\n} \n\n//CHECK#2\nif (isNaN(+0 % Number.NaN) !== true) {\n $ERROR('#2: +0 % NaN === Not-a-Number. Actual: ' + (+0 % NaN)); \n} \n\n//CHECK#3\nif (isNaN(-0 % Number.NaN) !== true) {\n $ERROR('#3: -0 % NaN === Not-a-Number. Actual: ' + (-0 % NaN)); \n} \n\n//CHECK#4\nif (isNaN(Number.POSITIVE_INFINITY % Number.NaN) !== true) {\n $ERROR('#4: Infinity % NaN === Not-a-Number. Actual: ' + (Infinity % NaN));\n} \n\n//CHECK#5\nif (isNaN(Number.NEGATIVE_INFINITY % Number.NaN) !== true) {\n $ERROR('#5: -Infinity % NaN === Not-a-Number. Actual: ' + ( -Infinity % NaN)); \n} \n\n//CHECK#6\nif (isNaN(Number.MAX_VALUE % Number.NaN) !== true) {\n $ERROR('#6: Number.MAX_VALUE % NaN === Not-a-Number. Actual: ' + (Number.MAX_VALUE % NaN));\n} \n\n//CHECK#7\nif (isNaN(Number.MIN_VALUE % Number.NaN) !== true) {\n $ERROR('#7: Number.MIN_VALUE % NaN === Not-a-Number. Actual: ' + (Number.MIN_VALUE % NaN)); \n}\n\n//CHECK#8\nif (isNaN(1 % Number.NaN) !== true) {\n $ERROR('#8: 1 % NaN === Not-a-Number. Actual: ' + (1 % NaN)); \n}\n",
+ "id": "S11.5.3_A4_T1.2"
+ },
+ {
+ "section": "11.5.3",
+ "description": "The sign of the finite non-zero value result equals the sign of the divided",
+ "test": "//CHECK#1\nif (1 % 1 !== 0) {\n $ERROR('#1.1: 1 % 1 === 0. Actual: ' + (1 % 1));\n} else {\n if (1 / (1 % 1) !== Number.POSITIVE_INFINITY) {\n $ERROR('#1.2: 1 % 1 === + 0. Actual: -0');\n }\n}\n\n//CHECK#2\nif (-1 % -1 !== -0) {\n $ERROR('#2.1: -1 % -1 === 0. Actual: ' + (-1 % -1));\n} else {\n if (1 / (-1 % -1) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#2.2: -1 % -1 === - 0. Actual: +0');\n }\n}\n\n//CHECK#3\nif (-1 % 1 !== -0) {\n $ERROR('#3.1: -1 % 1 === 0. Actual: ' + (-1 % 1));\n} else {\n if (1 / (-1 % 1) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#3.2: -1 % 1 === - 0. Actual: +0');\n }\n}\n\n//CHECK#4\nif (1 % -1 !== 0) {\n $ERROR('#4.1: 1 % -1 === 0. Actual: ' + (1 % -1));\n} else {\n if (1 / (1 % -1) !== Number.POSITIVE_INFINITY) {\n $ERROR('#4.2: 1 % -1 === + 0. Actual: -0');\n }\n}\n\n//CHECK#5\nif (101 % 51 !== 50) {\n $ERROR('#5: 101 % 51 === 50. Actual: ' + (101 % 51));\n}\n\n//CHECK#6\nif (101 % -51 !== 50) {\n $ERROR('#6: 101 % -51 === 50. Actual: ' + (101 % -51));\n}\n\n//CHECK#7\nif (-101 % 51 !== -50) {\n $ERROR('#7: -101 % 51 === -50. Actual: ' + (-101 % 51));\n}\n\n//CHECK#8\nif (-101 % -51 !== -50) {\n $ERROR('#8: -101 % -51 === -50. Actual: ' + (-101 % -51));\n}\n",
+ "id": "S11.5.3_A4_T2"
+ },
+ {
+ "section": "11.5.3",
+ "description": "If the dividend is an infinity results is NaN",
+ "test": "//CHECK#1\nif (isNaN(Number.NEGATIVE_INFINITY % Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#1: -Infinity % Infinity === Not-a-Number. Actual: ' + (-Infinity % Infinity));\n}\n\n//CHECK#2\nif (isNaN(Number.NEGATIVE_INFINITY % Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#2: -Infinity % -Infinity === Not-a-Number. Actual: ' + (-Infinity % -Infinity));\n}\n\n//CHECK#3\nif (isNaN(Number.POSITIVE_INFINITY % Number.POSITIVE_INFINITY) !== true) {\n $ERROR('#3: Infinity % Infinity === Not-a-Number. Actual: ' + (Infinity % Infinity));\n}\n\n//CHECK#4\nif (isNaN(Number.POSITIVE_INFINITY % Number.NEGATIVE_INFINITY) !== true) {\n $ERROR('#4: Infinity % -Infinity === Not-a-Number. Actual: ' + (Infinity % -Infinity));\n}\n\n//CHECK#5\nif (isNaN(Number.NEGATIVE_INFINITY % 1) !== true) {\n $ERROR('#5: Infinity % 1 === Not-a-Number. Actual: ' + (Infinity % 1));\n}\n\n//CHECK#6\nif (isNaN(Number.NEGATIVE_INFINITY % -1) !== true) {\n $ERROR('#6: -Infinity % -1 === Not-a-Number. Actual: ' + (-Infinity % -1));\n}\n\n//CHECK#7\nif (isNaN(Number.POSITIVE_INFINITY % 1) !== true) {\n $ERROR('#7: Infinity % 1 === Not-a-Number. Actual: ' + (Infinity % 1));\n}\n\n//CHECK#8\nif (isNaN(Number.POSITIVE_INFINITY % -1) !== true) {\n $ERROR('#8: Infinity % -1 === Not-a-Number. Actual: ' + (Infinity % -1));\n}\n\n//CHECK#9\nif (isNaN(Number.NEGATIVE_INFINITY % Number.MAX_VALUE) !== true) {\n $ERROR('#9: Infinity % Number.MAX_VALUE === Not-a-Number. Actual: ' + (Infinity % Number.MAX_VALUE));\n}\n\n//CHECK#10\nif (isNaN(Number.NEGATIVE_INFINITY % -Number.MAX_VALUE) !== true) {\n $ERROR('#10: -Infinity % -Number.MAX_VALUE === Not-a-Number. Actual: ' + (-Infinity % -Number.MAX_VALUE));\n}\n\n//CHECK#11\nif (isNaN(Number.POSITIVE_INFINITY % Number.MAX_VALUE) !== true) {\n $ERROR('#11: Infinity % Number.MAX_VALUE === Not-a-Number. Actual: ' + (Infinity % Number.MAX_VALUE));\n}\n\n//CHECK#12\nif (isNaN(Number.POSITIVE_INFINITY % -Number.MAX_VALUE) !== true) {\n $ERROR('#12: Infinity % -Number.MAX_VALUE === Not-a-Number. Actual: ' + (Infinity % -Number.MAX_VALUE));\n}\n",
+ "id": "S11.5.3_A4_T3"
+ },
+ {
+ "section": "11.5.3",
+ "description": "If the divisor is zero results is NaN",
+ "test": "//CHECK#1\nif (isNaN(-0 % 0) !== true) {\n $ERROR('#1: -0 % 0 === Not-a-Number. Actual: ' + (-0 % 0));\n}\n\n//CHECK#2\nif (isNaN(-0 % -0) !== true) {\n $ERROR('#2: -0 % -0 === Not-a-Number. Actual: ' + (-0 % -0));\n}\n\n//CHECK#3\nif (isNaN(0 % 0) !== true) {\n $ERROR('#3: 0 % 0 === Not-a-Number. Actual: ' + (0 % 0));\n}\n\n//CHECK#4\nif (isNaN(0 % -0) !== true) {\n $ERROR('#4: 0 % -0 === Not-a-Number. Actual: ' + (0 % -0));\n}\n\n//CHECK#5\nif (isNaN(-1 % 0) !== true) {\n $ERROR('#5: 1 % 0 === Not-a-Number. Actual: ' + (1 % 0));\n}\n\n//CHECK#6\nif (isNaN(-1 % -0) !== true) {\n $ERROR('#6: -1 % -0 === Not-a-Number. Actual: ' + (-1 % -0));\n}\n\n//CHECK#7\nif (isNaN(1 % 0) !== true) {\n $ERROR('#7: 1 % 0 === Not-a-Number. Actual: ' + (1 % 0));\n}\n\n//CHECK#8\nif (isNaN(1 % -0) !== true) {\n $ERROR('#8: 1 % -0 === Not-a-Number. Actual: ' + (1 % -0));\n}\n\n//CHECK#9\nif (isNaN(Number.NEGATIVE_INFINITY % 0) !== true) {\n $ERROR('#9: Infinity % 0 === Not-a-Number. Actual: ' + (Infinity % 0));\n}\n\n//CHECK#10\nif (isNaN(Number.NEGATIVE_INFINITY % -0) !== true) {\n $ERROR('#10: -Infinity % -0 === Not-a-Number. Actual: ' + (-Infinity % -0));\n}\n\n//CHECK#11\nif (isNaN(Number.POSITIVE_INFINITY % 0) !== true) {\n $ERROR('#11: Infinity % 0 === Not-a-Number. Actual: ' + (Infinity % 0));\n}\n\n//CHECK#12\nif (isNaN(Number.POSITIVE_INFINITY % -0) !== true) {\n $ERROR('#12: Infinity % -0 === Not-a-Number. Actual: ' + (Infinity % -0));\n}\n\n//CHECK#13\nif (isNaN(Number.MIN_VALUE % 0) !== true) {\n $ERROR('#13: Number.MIN_VALUE % 0 === Not-a-Number. Actual: ' + (Number.MIN_VALUE % 0));\n}\n\n//CHECK#14\nif (isNaN(Number.MIN_VALUE % -0) !== true) {\n $ERROR('#14: -Number.MIN_VALUE % -0 === Not-a-Number. Actual: ' + (-Number.MIN_VALUE % -0));\n}\n\n//CHECK#15\nif (isNaN(Number.MAX_VALUE % 0) !== true) {\n $ERROR('#15: Number.MAX_VALUE % 0 === Not-a-Number. Actual: ' + (Number.MAX_VALUE % 0));\n}\n\n//CHECK#16\nif (isNaN(Number.MAX_VALUE % -0) !== true) {\n $ERROR('#16: Number.MAX_VALUE % -0 === Not-a-Number. Actual: ' + (Number.MAX_VALUE % -0));\n}\n",
+ "id": "S11.5.3_A4_T4"
+ },
+ {
+ "section": "11.5.3",
+ "description": "If dividend is finite and the divisor is an infinity, the result equals the dividend",
+ "test": "//CHECK#1\nif (1 % Number.NEGATIVE_INFINITY !== 1) {\n $ERROR('#1: 1 % -Infinity === 1. Actual: ' + (1 % -Infinity));\n}\n//CHECK#2\nif (1 % Number.POSITIVE_INFINITY !==1) {\n $ERROR('#2: 1 % Infinity === 1. Actual: ' + (1 % Infinity));\n}\n\n//CHECK#3\nif (-1 % Number.POSITIVE_INFINITY !== -1) {\n $ERROR('#3: -1 % Infinity === -1. Actual: ' + (-1 % Infinity));\n}\n\n//CHECK#4\nif (-1 % Number.NEGATIVE_INFINITY !== -1) {\n $ERROR('#4: -1 % -Infinity === -1. Actual: ' + (-1 % -Infinity));\n}\n\n//CHECK#5\nif (0 % Number.POSITIVE_INFINITY !== 0) {\n $ERROR('#5.1: 0 % Infinity === 0. Actual: ' + (0 % Infinity));\n} else {\n if (1 / (0 % Number.POSITIVE_INFINITY) !== Number.POSITIVE_INFINITY) {\n $ERROR('#5.2: 0 % Infinity === + 0. Actual: -0');\n }\n}\n\n//CHECK#6\nif (0 % Number.NEGATIVE_INFINITY !== 0) {\n $ERROR('#6.1: 0 % -Infinity === 0. Actual: ' + (0 % -Infinity));\n} else {\n if (1 / (0 % Number.NEGATIVE_INFINITY) !== Number.POSITIVE_INFINITY) {\n $ERROR('#6.2: 0 % -Infinity === + 0. Actual: -0');\n }\n}\n\n//CHECK#7\nif (-0 % Number.POSITIVE_INFINITY !== -0) {\n $ERROR('#7.1: -0 % Infinity === 0. Actual: ' + (-0 % Infinity));\n} else {\n if (1 / (-0 % Number.POSITIVE_INFINITY) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#7.2: -0 % Infinity === - 0. Actual: +0');\n }\n}\n\n//CHECK#8\nif (-0 % Number.NEGATIVE_INFINITY !== -0) {\n $ERROR('#8.1: -0 % -Infinity === 0. Actual: ' + (-0 % -Infinity));\n} else {\n if (1 / (-0 % Number.NEGATIVE_INFINITY) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#8.2: -0 % -Infinity === - 0. Actual: +0');\n }\n}\n\n//CHECK#9\nif (Number.MAX_VALUE % Number.NEGATIVE_INFINITY !== Number.MAX_VALUE) {\n $ERROR('#9: Number.MAX_VALUE % -Infinity === Number.MAX_VALUE. Actual: ' + (Number.MAX_VALUE % -Infinity));\n}\n\n//CHECK#10\nif (Number.MAX_VALUE % Number.POSITIVE_INFINITY !== Number.MAX_VALUE) {\n $ERROR('#10: Number.MAX_VALUE % Infinity === Number.MAX_VALUE. Actual: ' + (Number.MAX_VALUE % Infinity));\n}\n\n//CHECK#11\nif (-Number.MAX_VALUE % Number.POSITIVE_INFINITY !== -Number.MAX_VALUE) {\n $ERROR('#11: -Number.MAX_VALUE % Infinity === -Number.MAX_VALUE. Actual: ' + (-Number.MAX_VALUE % Infinity));\n}\n\n//CHECK#12\nif (-Number.MAX_VALUE % Number.NEGATIVE_INFINITY !== -Number.MAX_VALUE) {\n $ERROR('#12: -Number.MAX_VALUE % -Infinity === -Number.MAX_VALUE. Actual: ' + (-Number.MAX_VALUE % -Infinity));\n}\n\n//CHECK#13\nif (Number.MIN_VALUE % Number.NEGATIVE_INFINITY !== Number.MIN_VALUE) {\n $ERROR('#13: Number.MIN_VALUE % -Infinity === Number.MIN_VALUE. Actual: ' + (Number.MIN_VALUE % -Infinity));\n}\n//CHECK#14\nif (Number.MIN_VALUE % Number.POSITIVE_INFINITY !== Number.MIN_VALUE) {\n $ERROR('#14: Number.MIN_VALUE % Infinity === Number.MIN_VALUE. Actual: ' + (Number.MIN_VALUE % Infinity));\n}\n\n//CHECK#15\nif (-Number.MIN_VALUE % Number.POSITIVE_INFINITY !== -Number.MIN_VALUE) {\n $ERROR('#15: -Number.MIN_VALUE % Infinity === -Number.MIN_VALUE. Actual: ' + (-Number.MIN_VALUE % Infinity));\n}\n\n//CHECK#16\nif (-Number.MIN_VALUE % Number.NEGATIVE_INFINITY !== -Number.MIN_VALUE) {\n $ERROR('#16: -Number.MIN_VALUE % -Infinity === -Number.MIN_VALUE. Actual: ' + (-Number.MIN_VALUE % -Infinity));\n}\n",
+ "id": "S11.5.3_A4_T5"
+ },
+ {
+ "section": "11.5.3",
+ "description": "If dividend is a zero and the divisor is nonzero finite, the result equals the dividend",
+ "test": "//CHECK#1\nif (0 % 1 !== 0) {\n $ERROR('#1.1: 0 % 1 === 0. Actual: ' + (0 % 1));\n} else {\n if (1 / (0 % 1) !== Number.POSITIVE_INFINITY) {\n $ERROR('#1.2: 0 % 1 === + 0. Actual: -0');\n }\n}\n\n//CHECK#2\nif (0 % -1 !== 0) {\n $ERROR('#2.1: 0 % -1 === 0. Actual: ' + (0 % -1));\n} else {\n if (1 / (0 % -1) !== Number.POSITIVE_INFINITY) {\n $ERROR('#2.2: 0 % -1 === + 0. Actual: -0');\n }\n}\n\n//CHECK#3\nif (-0 % 1 !== -0) {\n $ERROR('#3.1: -0 % 1 === 0. Actual: ' + (-0 % 1));\n} else {\n if (1 / (-0 % 1) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#3.2: -0 % 1 === - 0. Actual: +0');\n }\n}\n\n//CHECK#4\nif (-0 % -1 !== -0) {\n $ERROR('#4.1: -0 % -1 === 0. Actual: ' + (-0 % -1));\n} else {\n if (1 / (-0 % -1) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#4.2: 0 % -1 === - 0. Actual: +0');\n }\n}\n\n//CHECK#5\nif (0 % Number.MAX_VALUE !== 0) {\n $ERROR('#5.1: 0 % Number.MAX_VALUE === 0. Actual: ' + (0 % Number.MAX_VALUE));\n} else {\n if (1 / (0 % Number.MAX_VALUE) !== Number.POSITIVE_INFINITY) {\n $ERROR('#5.2: 0 % Number.MAX_VALUE === + 0. Actual: -0');\n }\n}\n\n//CHECK#6\nif (0 % Number.MIN_VALUE !== 0) {\n $ERROR('#6.1: 0 % Number.MIN_VALUE === 0. Actual: ' + (0 % Number.MIN_VALUE));\n} else {\n if (1 / (0 % Number.MIN_VALUE) !== Number.POSITIVE_INFINITY) {\n $ERROR('#6.2: 0 % Number.MIN_VALUE === + 0. Actual: -0');\n }\n}\n\n//CHECK#7\nif (-0 % Number.MAX_VALUE !== -0) {\n $ERROR('#7.1: -0 % Number.MAX_VALUE === 0. Actual: ' + (-0 % Number.MAX_VALUE));\n} else {\n if (1 / (-0 % Number.MAX_VALUE) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#7.2: -0 % Number.MAX_VALUE === - 0. Actual: +0');\n }\n}\n\n//CHECK#8\nif (-0 % Number.MIN_VALUE !== -0) {\n $ERROR('#8.1: -0 % Number.MIN_VALUE === 0. Actual: ' + (-0 % Number.MIN_VALUE));\n} else {\n if (1 / (-0 % Number.MIN_VALUE) !== Number.NEGATIVE_INFINITY) {\n $ERROR('#8.2: 0 % Number.MIN_VALUE === - 0. Actual: +0');\n }\n}\n",
+ "id": "S11.5.3_A4_T6"
+ },
+ {
+ "section": "11.5.3, 15.8.2.9",
+ "description": "If operands neither an infinity, nor a zero, nor NaN, return x - truncate(x / y) * y",
+ "test": "function truncate(x) {\n if (x > 0) {\n return Math.floor(x);\n } else {\n return Math.ceil(x);\n }\n}\n\n//CHECK#1\nx = 1.3; \ny = 1.1;\nif (x % y !== 0.19999999999999996) {\n $ERROR('#1: x = 1.3; y = 1.1; x % y === 0.19999999999999996. Actual: ' + (x % y));\n}\n\n//CHECK#2\nx = -1.3; \ny = 1.1; \nif (x % y !== -0.19999999999999996) {\n $ERROR('#2: x = -1.3; y = 1.1; x % y === -0.19999999999999996. Actual: ' + (x % y));\n}\n\n//CHECK#3\nx = 1.3; \ny = -1.1;\nif (x % y !== 0.19999999999999996) {\n $ERROR('#3: x = 1.3; y = -1.1; x % y === 0.19999999999999996. Actual: ' + (x % y));\n}\n\n//CHECK#4\nx = -1.3; \ny = -1.1;\nif (x % y !== -0.19999999999999996) {\n $ERROR('#4: x = -1.3; y = -1.1; x % y === -0.19999999999999996. Actual: ' + (x % y));\n}\n\n//CHECK#5\nx = 1.3; \ny = 1.1;\nif (x % y !== x - truncate(x / y) * y) {\n $ERROR('#5: x = 1.3; y = 1.1; x % y === x - truncate(x / y) * y. Actual: ' + (x % y));\n}\n\n//CHECK#6\nx = -1.3; \ny = 1.1; \nif (x % y !== x - truncate(x / y) * y) {\n $ERROR('#6: x = -1.3; y = 1.1; x % y === x - truncate(x / y) * y. Actual: ' + (x % y));\n}\n\n//CHECK#7\nx = 1.3; \ny = -1.1;\nif (x % y !== x - truncate(x / y) * y) {\n $ERROR('#7: x = 1.3; y = -1.1; x % y === x - truncate(x / y) * y. Actual: ' + (x % y));\n}\n\n//CHECK#8\nx = -1.3; \ny = -1.1;\nif (x % y !== x - truncate(x / y) * y) {\n $ERROR('#8: x = -1.3; y = -1.1; x % y === x - truncate(x / y) * y. Actual: ' + (x % y));\n}\n",
+ "id": "S11.5.3_A4_T7"
+ }
+ ]
+ }
+}