test262/website/resources/scripts/testcases2/15.8.1.7_SQRT1_2.json

37 lines
1.6 KiB
JSON

{
"testCollection": {
"name": "15.8.1.7_SQRT1_2",
"numTests": 4,
"tests": [
{
"section": "15.8.1.7",
"description": "Comparing Math.SQRT1_2 with 0.7071067811865476",
"test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\");\n\n// CHECK#1\nif (!isEqual(Math.SQRT1_2, 0.7071067811865476)) {\n $ERROR('#1: \\'Math.SQRT1_2 is not approximatley equal to 0.7071067811865476\\'');\n}\n\n",
"id": "S15.8.1.7_A1"
},
{
"section": "15.8.1.7",
"description": "Checking if Math.SQRT1_2 property has the attribute DontEnum",
"test": "// CHECK#1\nfor(x in Math) {\n if(x === \"SQRT1_2\") {\n $ERROR('#1: Value Property SQRT1_2 of the Math Object hasn\\'t attribute DontEnum: \\'for(x in Math) {x===\"SQRT1_2\"}\\'');\n }\n}\n\n",
"id": "S15.8.1.7_A2"
},
{
"section": "15.8.1.7",
"description": "Checking if Math.SQRT1_2 property has the attribute DontDelete",
"strict_mode_negative": "",
"test": "// CHECK#1\nif (delete Math.SQRT1_2 === true) {\n $ERROR(\"#1: Value Property SQRT1_2 of the Math Object hasn't attribute DontDelete: 'Math.SQRT1_2 === true'\");\n}\n\n",
"id": "S15.8.1.7_A3",
"strict_only": ""
},
{
"section": "15.8.1.7",
"description": "Checking if Math.SQRT1_2 property has the attribute ReadOnly",
"strict_mode_negative": "",
"test": "// CHECK#1\nvar x = Math.SQRT1_2;\nMath.SQRT1_2 = 1;\nif (Math.SQRT1_2 !== x) {\n $ERROR('#1: Math.SQRT1_2 hasn\\'t ReadOnly: \\'x = Math.SQRT1_2;Math.SQRT1_2 = 1;Math.SQRT1_2 === x\\'');\n}\n",
"id": "S15.8.1.7_A4",
"strict_only": ""
}
]
}
}