test262/website/resources/scripts/testcases2/15.8.1.6_PI.json

37 lines
1.5 KiB
JSON

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