76 Commits

Author SHA1 Message Date
Richard Gibson
c58ac691eb Test that "infinity" is not recognized as numeric 2022-04-04 16:56:40 -04:00
Richard Gibson
c572588ea9 Test that "INFINITY" is not recognized as numeric
Fixes #3442
2022-04-04 16:56:40 -04:00
rwaldron
2fcc43df17 Transform legacy format to harness assertions: test/built-ins/N*/**/*.js 2021-09-02 11:34:34 -07:00
Rick Waldron
2c3300312e
chore: migrate $ERROR -> throw new Test262Error in test/built-ins/Number (#3089) 2021-07-21 14:25:53 -07:00
Rick Waldron
d576baf73f Info: adds "sec-evaluatenew" step to info for all "not-a-constructor.js" tests. 2020-10-06 12:01:34 -04:00
Rick Waldron
8aacff591c Standardize built-in constructor testing 2020-10-06 12:01:34 -04:00
Rick Waldron
c644ede430 Built-in function objects that are not identified as constructors must throw a TypeError exception when new'ed. Fixes gh-1739 2020-10-06 12:01:34 -04:00
Rick Waldron
81db9994c9 Cover NumericLiteral..toString, NaN.toString, Infinity.toString. Fixes gh-1732 2020-09-17 16:24:33 -04:00
Rick Waldron
58559ddddd Coverage: Number.prototype.toPrecision throws a RangeError if precision cannot be coerced to a number in range. Fixes gh-2765 2020-09-14 13:36:22 -04:00
Rick Waldron
1d142259bc *.prototype.toString(), a-z make radix loop condition inclusive of radix 36 2020-05-13 09:22:25 -04:00
Rick Waldron
eff5ba2c98 BigInt/Number.prototype.toString(...), Step 6 2020-05-08 12:16:16 -04:00
Mårten Nordheim
9da54d053d Fix #2605; make safe-integer.js call isSafeInteger
The folder and file name implies it should be using isSafeInteger rather
than isInteger which it was using.
2020-05-06 10:51:31 -04:00
Leo Balter
ff9763729d Remove duplicated es[56]id if esid is present 2019-08-05 10:54:37 -04:00
Caio Lima
1dc78879d4 Add edge tests to verify BigInt to Number conversion when BigInt can't directly be represented by a Number. 2019-07-19 13:53:01 -04:00
Leo Balter
ac55e29ed0 Fix yaml consistency 2018-03-06 14:36:02 -05:00
Rick Waldron
9a211b1c9f built-ins/Number/*: make all indentation consistent (depth & character) (#1436) 2018-02-15 15:11:50 -05:00
André Bargull
f95b56ab28 Revert "js-beautify: make all indentation consistent (depth & character) (#1409)" (#1412)
This reverts commit a01de4a722d088055a7d84d8c691ddd7109edb34.
2018-02-09 12:09:47 -05:00
Rick Waldron
a01de4a722 js-beautify: make all indentation consistent (depth & character) (#1409) 2018-02-09 11:35:37 -05:00
Leo Balter
6d5a7adf4e Fix ToNumber operations 2018-02-08 11:13:54 -05:00
Leo Balter
53c00784b6 Revert "Revert "Tests for NumericSeparatorLiteral. Closes gh-1051" (#1188)"
This reverts commit 8422147c17aa3f4061e524a8f88c251a3b371ecf.
2018-02-08 11:13:54 -05:00
André Bargull
f717982c94 Remove unused includes 2018-01-25 13:59:37 -05:00
Rick Waldron
02f1a0b630 Frontmatter: fixup "info: >" to "info: |" 2018-01-05 12:50:00 -05:00
Ivan Vyshnevskyi
7b868091a7 Add ToNumber tests for invalid HexIntegralLiterals 2018-01-05 12:48:57 -05:00
Ivan Vyshnevskyi
d540256163 Add more ToNumber tests for invalid binary and octal literals 2018-01-05 12:48:57 -05:00
Rick Waldron
92a2621901 Frontmatter: fixup "info: >" to "info: |" 2018-01-05 12:27:59 -05:00
Leo Balter
60782de95e Tag tests for U+180E and complete coverage for RegExp matching 2017-09-25 15:27:59 -04:00
Leo Balter
7cbbe51216 Add cross-realm feature 2017-09-22 15:29:10 -04:00
Robin Templeton
37beb36524
add BigInt tests 2017-08-24 15:58:14 -04:00
Leo Balter
8422147c17 Revert "Tests for NumericSeparatorLiteral. Closes gh-1051" (#1188) 2017-08-21 11:54:21 -04:00
Rick Waldron
9380826d5b Tests for NumericSeparatorLiteral, Number(...) 2017-08-17 09:50:33 -04:00
Daniel Ehrenberg
e2ee94f452 Fix tests for toFixed and toExponential (#1080)
toExponential had a typo, and toFixed was against an earlier version
of the specification proposal. The tests pass against a version of V8
which attempts to implement the new spec.
2017-06-28 10:29:47 -04:00
Daniel Ehrenberg
0314c87b08 Add tests for Number printing precision ranges (#932)
These tests are against the needs-consensus pull request at
https://github.com/tc39/ecma262/pull/857
2017-06-12 20:10:15 -03:00
André Bargull
d59e30c95e Remove execute bit from files (#976) 2017-04-13 16:24:07 -04:00
Daniel Ehrenberg
73c2d51734
Fix toFixed test to invoke toString() properly 2017-04-06 19:40:22 -04:00
Daniel Ehrenberg
e9a745646a Test for the difference between toFixed and toString
This test comes from a note in the specification under toFixed.
It fails in ChakraCore and passes in other engines that I tested.
2017-03-23 19:05:32 +01:00
Rick Waldron
fdd2fa9b1c Rename $ => $262. Fixes gh-802 (#823)
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-03-01 16:34:15 -05:00
Michael "Z" Goddard
ced9bfd7be Test that Number.prototype.toFixed.length is 1 (#826)
Add a test to confirm that the length member of
Number.prototype.toFixed is 1.
2017-01-19 22:33:53 -05:00
K. Adam White
182e0dee7b Remove es6id line per PR review 2017-01-19 14:51:57 -05:00
K. Adam White
5d69e30929 Add Number.prototype.toFixed return value test
Adds a test to ensure that toFixed returns a string value
2017-01-19 14:51:57 -05:00
jugglinmike
71e573f7da Add tests for realm interactions (#688)
* Add tests for prototype realm inference

* Add tests for miscellaneous realm concerns

* Add tests for realm of spec-created Errors

In some cases, Error objects produced by the specification are
observable from ECMAScript code. Among these cases, some are further
differentiated in that they occur outside of any built-in function and
may be triggered through syntactic production directly. The current
realm record is commonly interpreted incorrectly under these
circumstances.

Add tests asserting that the expected realm record is used when
constructing such Error objects.

* Add tests for realm use in ArraySpeciesCreate

* Add tests for function realm retrieval

* Add tests for cross-realm behaviors of Symbols

* Add tests for GetValue and PutValue

* Add tests for realm of spec-created Arrays

In some cases, Arrays produced by CreateArrayFromList are observable
from ECMAScript code. Among these cases, two occur outside of any
built-in function and may be triggered through syntactic production
directly. The current realm record is commonly interpreted incorrectly
under these circumstances.

Add tests asserting that the expected realm record is used when
constructing arrays.

* Add test for spec-created object

* fixup! Add tests for realm of spec-created Errors

* fixup! Add tests for realm of spec-created Errors

* fixup! Add tests for prototype realm inference

* fixup! Add tests for miscellaneous realm concerns
2016-10-24 10:43:17 -07:00
Viktor
29c2384449 Update return-values.js (Number#toExponential bug in Firefox) (#751)
Update test cases for Number#toExponential

Includes test cases addressing a known bug on Firefox 48.

Ref https://bugzilla.mozilla.org/show_bug.cgi?id=944846
2016-08-29 17:33:55 -04:00
Leo Balter
3275f17cd4 Add tests for Number#toExponential (#664)
* Add tests for Number#toExponential
2016-07-21 10:57:05 -07:00
Mathias Bynens
3a5a09eba2 Ensure U+180E is no longer considered whitespace
Ref. https://hashseed.blogspot.com/2014/08/in-ecma-262-5.html
Ref. https://github.com/tc39/ecma262/pull/300#issuecomment-181376767
Ref. 9b10d2a597

Fix and add @anba’s U+180E tests
2016-07-06 10:11:32 -04:00
Leo Balter
e49d2661a8 Improve assertions comparing values to NaN (#690)
The global isNaN is not precise at all, and Number.isNaN is an ES6 feature that makes it preferrable to use assert's sameValue for NaN values, as it handles it internally using the comparison.
2016-07-01 11:22:55 -07:00
Leonardo Balter
1eaae52eb8 Add prop-desc tests for Number.prototype properties 2016-06-23 14:42:40 -04:00
Leonardo Balter
4dd7e5aa4b Extend Number tests to assert abrupt completions 2016-06-23 14:42:40 -04:00
Leonardo Balter
9223f56344 Update and add basic prop-desc tests for Number
and Number.prototype
2016-06-23 14:42:40 -04:00
Leonardo Balter
8066b9ecaf Add tests for Number.{parseFloat,parseInt} 2016-06-23 14:42:39 -04:00
Leonardo Balter
47f806ecef Update tests for Number.NaN 2016-06-23 14:42:39 -04:00
Leonardo Balter
4492b8032b Add tests for Number.isSafeInteger 2016-06-23 14:42:39 -04:00