summaryrefslogtreecommitdiff
path: root/test/built-ins/NaN
diff options
context:
space:
mode:
authorBrian Terlson <brian.terlson@microsoft.com>2014-12-05 15:50:00 -0800
committerBrian Terlson <brian.terlson@microsoft.com>2014-12-07 15:33:09 -0800
commit2a74f0ec1b671f15fc7df3e1e294a65abc8ebac8 (patch)
tree7315f60ffd86513bf163c05e4252fab0810bfbe8 /test/built-ins/NaN
parentda465e7399bcecd3c78fa1f5e898c9d52b4c7096 (diff)
downloadqtdeclarative-testsuites-2a74f0ec1b671f15fc7df3e1e294a65abc8ebac8.tar.gz
Reorganize ./test
Diffstat (limited to 'test/built-ins/NaN')
-rw-r--r--test/built-ins/NaN/15.1.1.1-0.js23
-rw-r--r--test/built-ins/NaN/S15.1.1.1_A1.js23
-rw-r--r--test/built-ins/NaN/S15.1.1.1_A3.1.js14
-rw-r--r--test/built-ins/NaN/S15.1.1.1_A3.2.js15
4 files changed, 75 insertions, 0 deletions
diff --git a/test/built-ins/NaN/15.1.1.1-0.js b/test/built-ins/NaN/15.1.1.1-0.js
new file mode 100644
index 000000000..93fc31ee4
--- /dev/null
+++ b/test/built-ins/NaN/15.1.1.1-0.js
@@ -0,0 +1,23 @@
+// Copyright (c) 2012 Ecma International. All rights reserved.
+// Ecma International makes this code available under the terms and conditions set
+// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+// "Use Terms"). Any redistribution of this code must retain the above
+// copyright and this notice and otherwise comply with the Use Terms.
+
+/*---
+es5id: 15.1.1.1-0
+description: Global.NaN is a data property with default attribute values (false)
+includes:
+ - runTestCase.js
+ - fnGlobalObject.js
+---*/
+
+function testcase() {
+ var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), 'NaN');
+ if (desc.writable === false &&
+ desc.enumerable === false &&
+ desc.configurable === false) {
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/test/built-ins/NaN/S15.1.1.1_A1.js b/test/built-ins/NaN/S15.1.1.1_A1.js
new file mode 100644
index 000000000..ee487c4f3
--- /dev/null
+++ b/test/built-ins/NaN/S15.1.1.1_A1.js
@@ -0,0 +1,23 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The initial value of NaN is NaN
+es5id: 15.1.1.1_A1
+description: Use typeof, isNaN, isFinite
+---*/
+
+// CHECK#1
+if (typeof(NaN) !== "number") {
+ $ERROR('#1: typeof(NaN) === "number". Actual: ' + (typeof(NaN)));
+}
+
+// CHECK#2
+if (isNaN(NaN) !== true) {
+ $ERROR('#2: NaN === Not-a-Number. Actual: ' + (NaN));
+}
+
+// CHECK#3
+if (isFinite(NaN) !== false) {
+ $ERROR('#3: NaN === Not-a-Finite. Actual: ' + (NaN));
+}
diff --git a/test/built-ins/NaN/S15.1.1.1_A3.1.js b/test/built-ins/NaN/S15.1.1.1_A3.1.js
new file mode 100644
index 000000000..bc23c3652
--- /dev/null
+++ b/test/built-ins/NaN/S15.1.1.1_A3.1.js
@@ -0,0 +1,14 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The NaN is DontDelete
+es5id: 15.1.1.1_A3.1
+description: Use delete
+flags: [noStrict]
+---*/
+
+// CHECK#1
+if (delete NaN !== false) {
+ $ERROR('#1: delete NaN === false. Actual: ' + (delete NaN));
+}
diff --git a/test/built-ins/NaN/S15.1.1.1_A3.2.js b/test/built-ins/NaN/S15.1.1.1_A3.2.js
new file mode 100644
index 000000000..9148a78ee
--- /dev/null
+++ b/test/built-ins/NaN/S15.1.1.1_A3.2.js
@@ -0,0 +1,15 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The NaN is DontEnum
+es5id: 15.1.1.1_A3.2
+description: Use for-in statement
+---*/
+
+// CHECK#1
+for (var prop in this) {
+ if (prop === "NaN") {
+ $ERROR('#1: The NaN is DontEnum');
+ }
+}