summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Math/ceil
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Math/ceil')
-rw-r--r--js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A1.js12
-rw-r--r--js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A2.js12
-rw-r--r--js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A3.js12
-rw-r--r--js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A4.js14
-rw-r--r--js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A5.js14
-rw-r--r--js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A6.js16
-rw-r--r--js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A7.js19
-rw-r--r--js/src/tests/test262/built-ins/Math/ceil/browser.js0
-rw-r--r--js/src/tests/test262/built-ins/Math/ceil/length.js31
-rw-r--r--js/src/tests/test262/built-ins/Math/ceil/name.js28
-rw-r--r--js/src/tests/test262/built-ins/Math/ceil/not-a-constructor.js31
-rw-r--r--js/src/tests/test262/built-ins/Math/ceil/prop-desc.js19
-rw-r--r--js/src/tests/test262/built-ins/Math/ceil/shell.js24
13 files changed, 232 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A1.js b/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A1.js
new file mode 100644
index 0000000000..b2033ef097
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A1.js
@@ -0,0 +1,12 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: If x is NaN, Math.ceil(x) is NaN
+es5id: 15.8.2.6_A1
+description: Checking if Math.ceil(NaN) is NaN
+---*/
+
+assert.sameValue(Math.ceil(NaN), NaN);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A2.js b/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A2.js
new file mode 100644
index 0000000000..967d755a3b
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A2.js
@@ -0,0 +1,12 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: If x is +0, Math.ceil(x) is +0
+es5id: 15.8.2.6_A2
+description: Checking if Math.ceil(x) is +0, where x is +0
+---*/
+
+assert.sameValue(Math.ceil(0), 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A3.js b/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A3.js
new file mode 100644
index 0000000000..a6ffadfe18
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A3.js
@@ -0,0 +1,12 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: If x is -0, Math.ceil(x) is -0
+es5id: 15.8.2.6_A3
+description: Checking if Math.ceil(x) is -0, where x is -0
+---*/
+
+assert.sameValue(Math.ceil(-0), -0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A4.js b/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A4.js
new file mode 100644
index 0000000000..a7ab010f27
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A4.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: If x is +Infinity, Math.ceil(x) is +Infinity
+es5id: 15.8.2.6_A4
+description: Checking if Math.ceil(x) is +Infinity, where x is +Infinity
+---*/
+
+// CHECK#1
+var x = +Infinity;
+assert.sameValue(Math.ceil(x), +Infinity, 'Math.ceil(+Infinity) must return +Infinity');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A5.js b/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A5.js
new file mode 100644
index 0000000000..31f906be45
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A5.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: If x is -Infinity, Math.ceil(x) is -Infinity
+es5id: 15.8.2.6_A5
+description: Checking if Math.ceil(x) is -Infinity, where x is -Infinity
+---*/
+
+// CHECK#1
+var x = -Infinity;
+assert.sameValue(Math.ceil(x), -Infinity, 'Math.ceil(-Infinity) must return -Infinity');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A6.js b/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A6.js
new file mode 100644
index 0000000000..7304f1315d
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A6.js
@@ -0,0 +1,16 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: If x is less than 0 but greater than -1, Math.ceil(x) is -0
+es5id: 15.8.2.6_A6
+description: >
+ Checking if Math.ceil(x) is -0, where x is less than 0 but greater
+ than -1
+---*/
+
+assert.sameValue(Math.ceil(-0.000000000000001), -0, "-0.000000000000001");
+assert.sameValue(Math.ceil(-0.999999999999999), -0, "-0.999999999999999");
+assert.sameValue(Math.ceil(-0.5), -0, "-0.5");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A7.js b/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A7.js
new file mode 100644
index 0000000000..b5e16d9fb6
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/ceil/S15.8.2.6_A7.js
@@ -0,0 +1,19 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The value of Math.ceil(x) is the same as the value of -Math.floor(-x)
+es5id: 15.8.2.6_A7
+description: >
+ Checking if Math.ceil(x) equals to -Math.floor(-x) on 2000
+ floating point argument values
+---*/
+
+// CHECK#1
+for (var i = -1000; i < 1000; i++)
+{
+ var x = i / 10.0;
+ assert.sameValue(Math.ceil(x), -Math.floor(-x), 'Math.ceil(i / 10.0) must return -Math.floor(-x)');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/ceil/browser.js b/js/src/tests/test262/built-ins/Math/ceil/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/ceil/browser.js
diff --git a/js/src/tests/test262/built-ins/Math/ceil/length.js b/js/src/tests/test262/built-ins/Math/ceil/length.js
new file mode 100644
index 0000000000..c8717de985
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/ceil/length.js
@@ -0,0 +1,31 @@
+// Copyright (C) 2015 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+es6id: 20.2.2.10
+description: >
+ Math.ceil.length is 1.
+info: |
+ Math.ceil ( x )
+
+ 17 ECMAScript Standard Built-in Objects:
+ Every built-in Function object, including constructors, has a length
+ property whose value is an integer. Unless otherwise specified, this
+ value is equal to the largest number of named arguments shown in the
+ subclause headings for the function description, including optional
+ parameters. However, rest parameters shown using the form “...name”
+ are not included in the default argument count.
+
+ Unless otherwise specified, the length property of a built-in Function
+ object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
+ [[Configurable]]: true }.
+includes: [propertyHelper.js]
+---*/
+
+assert.sameValue(Math.ceil.length, 1);
+
+verifyNotEnumerable(Math.ceil, "length");
+verifyNotWritable(Math.ceil, "length");
+verifyConfigurable(Math.ceil, "length");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/ceil/name.js b/js/src/tests/test262/built-ins/Math/ceil/name.js
new file mode 100644
index 0000000000..df08f67866
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/ceil/name.js
@@ -0,0 +1,28 @@
+// Copyright (C) 2015 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+es6id: 20.2.2.10
+description: >
+ Math.ceil.name is "ceil".
+info: |
+ Math.ceil ( x )
+
+ 17 ECMAScript Standard Built-in Objects:
+ Every built-in Function object, including constructors, that is not
+ identified as an anonymous function has a name property whose value
+ is a String.
+
+ Unless otherwise specified, the name property of a built-in Function
+ object, if it exists, has the attributes { [[Writable]]: false,
+ [[Enumerable]]: false, [[Configurable]]: true }.
+includes: [propertyHelper.js]
+---*/
+
+assert.sameValue(Math.ceil.name, "ceil");
+
+verifyNotEnumerable(Math.ceil, "name");
+verifyNotWritable(Math.ceil, "name");
+verifyConfigurable(Math.ceil, "name");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/ceil/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/ceil/not-a-constructor.js
new file mode 100644
index 0000000000..8e2861138f
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/ceil/not-a-constructor.js
@@ -0,0 +1,31 @@
+// Copyright (C) 2020 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-ecmascript-standard-built-in-objects
+description: >
+ Math.ceil does not implement [[Construct]], is not new-able
+info: |
+ ECMAScript Function Objects
+
+ Built-in function objects that are not identified as constructors do not
+ implement the [[Construct]] internal method unless otherwise specified in
+ the description of a particular function.
+
+ sec-evaluatenew
+
+ ...
+ 7. If IsConstructor(constructor) is false, throw a TypeError exception.
+ ...
+includes: [isConstructor.js]
+features: [Reflect.construct, arrow-function]
+---*/
+
+assert.sameValue(isConstructor(Math.ceil), false, 'isConstructor(Math.ceil) must return false');
+
+assert.throws(TypeError, () => {
+ new Math.ceil();
+}, '`new Math.ceil()` throws TypeError');
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/ceil/prop-desc.js b/js/src/tests/test262/built-ins/Math/ceil/prop-desc.js
new file mode 100644
index 0000000000..2f4aef196b
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/ceil/prop-desc.js
@@ -0,0 +1,19 @@
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-math.ceil
+description: >
+ "ceil" property of Math
+info: |
+ Section 17: Every other data property described in clauses 18 through 26
+ and in Annex B.2 has the attributes { [[Writable]]: true,
+ [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
+includes: [propertyHelper.js]
+---*/
+
+verifyNotEnumerable(Math, "ceil");
+verifyWritable(Math, "ceil");
+verifyConfigurable(Math, "ceil");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/ceil/shell.js b/js/src/tests/test262/built-ins/Math/ceil/shell.js
new file mode 100644
index 0000000000..eda1477282
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/ceil/shell.js
@@ -0,0 +1,24 @@
+// GENERATED, DO NOT EDIT
+// file: isConstructor.js
+// Copyright (C) 2017 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: |
+ Test if a given function is a constructor function.
+defines: [isConstructor]
+features: [Reflect.construct]
+---*/
+
+function isConstructor(f) {
+ if (typeof f !== "function") {
+ throw new Test262Error("isConstructor invoked with a non-function value");
+ }
+
+ try {
+ Reflect.construct(function(){}, [], f);
+ } catch (e) {
+ return false;
+ }
+ return true;
+}