Add tests to ensure that:
1. First `byteLength` isn't larger than `maxByteLength`.
2. Then `OrdinaryCreateFromConstructor` is called.
3. And finally `Create{Shared}ByteDataBlock` is called.
Time zone identifiers supported by ICU, but which aren't valid IANA
identifiers.
Implementations not supporting ECMA-402 are theoretically allowed to
support these identifiers, so the tests have to go into the "intl402"
directory.
This adds tests specifically for every kind of case that changes due to
the tweak to the date difference algorithm: differences from a longer
month to a shorter month, when the months are adjacent, in the same year
but not adjacent, and in different years.
Also adds tests for a case that does *not* change, but would trip on an
incorrectly implemented algorithm: when the intermediate months value
falls at the end of February.
There was incidental coverage of the change to the date difference
algorithm in other tests. Those are adjusted, as well.
Normative change: https://github.com/tc39/proposal-temporal/pull/2759
Consensus in February 2024
Adapts the tests that checked arbitrarily long loops, to now check that an
exception is thrown if the loop would happen.
Adds tests that exercise the newly added checks on return values of
getPossibleInstantsFor and getOffsetNanosecondsFor that limit UTC offset
shifts to 24 hours or less.
Also updates some step numbers in related tests.
The existing tests didn't cover some edge cases where implementations
have to compute the exact result of `numerator / denominator`, where at
least one of `numerator` and `denominator` can't be exactly represented
by an IEEE-754 double precision floating point value.
"precision-exact-mathematical-values-5.js" gets added in #3961, so the
new tests from this commit start at "precision-exact-mathematical-values-6.js".
NormalizedTimeDurationToDays can no longer loop indefinitely, because at
a certain point we will hit the upper bound of MAX_SAFE_INTEGER, so rename
the test to reflect that it can loop an arbitrary but limited number of
times.
Add a test for the RangeError condition in NormalizedTimeDurationToDays
when the time zone calculates a day length that is not a safe integer
number of nanoseconds.
While editing these tests, rename them to match the current name of the AO
and make sure the step numbers are up to date. (Normally I wouldn't care
so much about that, but these tests can be pretty confusing so it's good
to be able to refer to the spec text.)
Adapts or removes tests that relied on creating durations that are now out
of range. Adds new tests for maximum in-range and minimum out-of-range
durations.
* Test closing async-from-sync iterator when resolving result promise abrupt completes.
These test new steps 6-6.a of AsyncFromSyncIteratorContinuation
as per normative changes of ecma626 PR 2600
https://github.com/tc39/ecma262/pull/2600
* Apply suggestions from code review
Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
* Apply suggestions from code review
Co-authored-by: Nicolò Ribaudo <hello@nicr.dev>
* Refactoring tests to use the Async Helpers.
---------
Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
Co-authored-by: Nicolò Ribaudo <hello@nicr.dev>
* Adjust existing tests to match new spec for async-from-sync iterators
Testing normative changes of ecma626 PR 2600
* Test that async-from-sync iterator closes when throw is undefined.
These test paths from newly added call to IteratorClose in step 7.c of
%AsyncFromSyncIteratorPrototype%.throw
as per normative changes of ecma626 PR 2600
* Apply suggestions from code review
Co-authored-by: Jordan Harband <ljharb@gmail.com>
* Refactoring tests to use the Async Helpers.
Addresses review comments
- https://github.com/tc39/test262/pull/3976/files#r1451071569
- https://github.com/tc39/test262/pull/3976/files#r1451075479
---------
Co-authored-by: Jordan Harband <ljharb@gmail.com>
We stored Temporal.PlainDateTime.compare in a variable for convenience but
then used Temporal.PlainDate.compare instead. The variable was actually
intended to be used here. No change in functionality.
* update constructor and toStringTag properties on Iterator.prototype
* includes cannot be empty for some reason
* update description
* add esid
* updates
* freeze Iterator.prototype
* don't try to use real GeneratorPrototype for these tests
Hosts are free to throw whatever error they want during module loading: there is no guarantee that the error thrown due to the import with `type: "foo"` is a SyntaxError.
* add tests for difference, intersection, symmetricDifference
* add tests for predicates
* more tests for ordering of calls
* fix copyrights
* add missed -0 test
* pass argument to methods, not just this
* assert methods return new objects
* typo in filename
* fix parens
* Update test/built-ins/Set/prototype/difference/add-not-called.js
Co-authored-by: Jordan Harband <ljharb@gmail.com>
* fix isSupersetOf/set-like-array.js
* add tests for negative zero with isDisjointFrom and isSupersetOf
* fix message in isSupersetOf/converts-negative-zero.js
* address comments from review
---------
Co-authored-by: Jordan Harband <ljharb@gmail.com>