diff options
Diffstat (limited to 'website/resources/scripts/testcases2/8.3_The_Boolean_Type.json')
-rw-r--r-- | website/resources/scripts/testcases2/8.3_The_Boolean_Type.json | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/website/resources/scripts/testcases2/8.3_The_Boolean_Type.json b/website/resources/scripts/testcases2/8.3_The_Boolean_Type.json new file mode 100644 index 000000000..d1cfb8bb1 --- /dev/null +++ b/website/resources/scripts/testcases2/8.3_The_Boolean_Type.json @@ -0,0 +1,40 @@ +{ + "testCollection": { + "name": "8.3_The_Boolean_Type", + "numTests": 5, + "tests": [ + { + "section": "8.3", + "description": "Assign true and false to variables", + "test": "if (x == undefined) {\n $ERROR(\"x == undefined, but actual is \"+ x);\n} \n\n////////////////////////////////////////////////////////////////////////\n// CHECK#1\nvar x = true;\nvar y = false;\n//\n////////////////////////////////////////////////////////////////////////\n", + "id": "S8.3_A1_T1" + }, + { + "section": "8.3", + "description": "Check type of true/false and it`s equality", + "test": "//////////////////////////////////////////////////////////////////////\n// CHECK#1\nif (typeof(true) !== \"boolean\") {\n $ERROR('#1: typeof(true) === \"boolean\"');\n}\n//\n//////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////\n// CHECK#2\nif (typeof(true) != \"boolean\") {\n $ERROR('#2: typeof(true) == \"boolean\"');\n}\n//\n//////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////\n// CHECK#3\nif (typeof(false) !== \"boolean\") {\n $ERROR('#3: typeof(false) === \"boolean\"');\n}\n//\n//////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////\n// CHECK#4\nif (typeof(false) != \"boolean\") {\n $ERROR('#4: typeof(false) == \"boolean\"');\n}\n//\n//////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////\n// CHECK#5\nif (true === false) {\n $ERROR('#5: true !== false');\n}\n//\n//////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////\n// CHECK#6\nif (true == false) {\n $ERROR('#6: true != false');\n}\n//\n//////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////\n// CHECK#7\nif (false === true) {\n $ERROR('#7: false !== true');\n}\n//\n//////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////\n// CHECK#8\nif (false == true) {\n $ERROR('#8: false != true');\n}\n//\n//////////////////////////////////////////////////////////////////////\n\n", + "id": "S8.3_A1_T2" + }, + { + "section": "8.3", + "description": "Checking if execution of \"true=1\" fails", + "negative": "", + "test": "true = 1;\n", + "id": "S8.3_A2.1" + }, + { + "section": "8.3", + "description": "Checking if execution of \"false=0\" fails", + "negative": "", + "test": "false = 0;\n", + "id": "S8.3_A2.2" + }, + { + "section": "8.3", + "description": "Check not false equals true, not true equals false", + "test": "//////////////////////////////////////////////////////////////////////////////\n//CHECK#1\nif (!false !== true){\n $ERROR('#1: !false === true');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#2\nif (!false != true){\n $ERROR('#2: !false == true');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#3\nif (!true !== false){\n $ERROR('#3: !true === false');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n\n//////////////////////////////////////////////////////////////////////////////\n//CHECK#4\nif (!true != false){\n $ERROR('#4: !true == false');\n}\n//\n//////////////////////////////////////////////////////////////////////////////\n", + "id": "S8.3_A3" + } + ] + } +} |