Commit Graph

15 Commits

Author SHA1 Message Date
Philip Chimento d5404f4d24 Temporal: Improve existing tests for ZDT#toString timeZoneName option
Based on the improvements just made to the calendarName option, improve
the tests for the timeZoneName option of ZonedDateTime.prototype.toString
as well.
2022-10-11 12:19:49 +02:00
Philip Chimento 0c18f7045b Temporal: Expand and regularize existing calendarName option tests
Since we are going to be adding a new test for calendarName: "critical",
take the existing tests for various values of the calendarName option, and
regularize them. Previously, depending on which type's toString() method
was under test, the tests had various degrees of thoroughness, and some
were only present in staging.
2022-10-11 12:19:49 +02:00
Philip Chimento 46c3823117 Temporal: Add TemporalHelpers.crossDateLineTimeZone
Several tests in staging use the Pacific/Apia IANA time zone to test the
behaviour of various algorithms for the case where Samoa skipped the
entire day of Dec. 30, 2011, when they switched from one side of the
International Date Line to the other. Since implementations are not
technically required to support IANA time zones, add a fake Samoa time
zone to TemporalHelpers that has the same transition, and use it in those
tests.

(The time zone isn't exactly the same as Pacific/Apia, since Samoa also
observes DST and this time zone doesn't. It's only the same for this one
transition.)

See: #3649
2022-10-03 12:24:00 +02:00
Philip Chimento 886f091bd3 Temporal: Use TemporalHelpers.springForwardFallBackTimeZone in staging
Some tests in staging used various IANA time zones in order to test DST
behaviour. Since implementations are technically not required to
understand IANA time zones, we have a fake DST time zone in
TemporalHelpers. Use that instead.

For a few cases where it's not practical to use the fake DST time zone
(because it only has one spring-forward and one fall-back transition, for
example), move a few tests into staging/Intl402/Temporal/.

See: #3649
2022-10-03 12:24:00 +02:00
Philip Chimento 42074e7fe7 Temporal: Remove calendars and time zones from tests in staging
As much as possible, remove non-ISO calendars and IANA time zones from the
Temporal tests in the staging folder.

In most cases, the non-ISO calendar can be replaced with the ISO calendar.
In other cases, create a custom calendar object with the appropriate
return value from toString(), and any other methods needed for that
particular test.

For time zones, in most cases the time zone can be replaced with UTC or a
constant offset time zone. Sometimes a custom time zone object with the
appropriate toString() is sufficient.

Move timezone-america-la.js to staging/Intl402/Temporal/ since its whole
point is to test an IANA time zone. Create a new tzdb-transitions.js in
staging/Intl402/Temporal to test behaviour of Temporal.TimeZone's
getPreviousTransition and getNextTransition for IANA time zones, since
UTC and constant offset time zones always return null for these methods.

There are still some cases where specific DST behaviour is tested. These
will be addressed in following commits.

See: #3649
2022-10-03 12:24:00 +02:00
Philip Chimento 4155842c37 Temporal: Regularize and expand tests for round() rounding modes
Take all the existing tests for round() calculations using different
rounding modes and standardize them. Add tests for Duration, Instant and
ZonedDateTime, which were still in the old format in staging.
2022-09-21 11:48:28 +02:00
Philip Chimento a788188c2f Temporal: Regularize and expand tests for difference rounding modes
Take all the existing tests for since/until calculations using different
rounding modes and standardize them. Add tests for Instant and
ZonedDateTime, which were still in the old format in staging.
2022-09-21 11:48:28 +02:00
Shu-yu Guo 465cf4a5c0
Fix resizable ArrayBuffer subarray tests (#3671)
This is from the normative change in
https://github.com/tc39/proposal-resizablearraybuffer/pull/93, which
got consensus in the March 2022 TC39.
2022-09-19 17:45:26 -07:00
Frank Yung-Fong Tang 9215420dee Fix limit test
The doAsserts is not correct for case like "P100000000000000000000000000Y"
If we test "P100000000000000000000000000Y" because the filed in Duration is only required to 
"A float64-representable integer is an integer that is exactly representable as a Number value. That is, for a float64-representable integer x, it must hold that ℝ(𝔽(x)) = x." per 
https://tc39.es/proposal-temporal/#sec-properties-of-temporal-duration-instances

The duration it hold may produce string such as
"P99999999999999987584860160Y" 

even the test only test the first 10 digits ( log(10^10)/log(2) = 33 bits)
Change the test to test 

"P100000000000001000000000000Y" instead, so a negative numerical error will not change the start of the string 
from "P1000000000" to "P9999999999"
2022-09-16 11:38:26 -07:00
Frank Yung-Fong Tang aa3afd1c28 Remove "15Z" to for PlainTime.from test
"15Z" will throw RangeError because Z match 
UTCDesignator => 
TimeZoneUTCOffset => 
TimeZoneUTCOffset TimeZoneBracketedAnnotationopt => 
TimeZoneopt 

and "15" match
1 DecimalDigit =>
Hour =>
TimeHour  =>
TimeSpec 

so "15Z" match
TimeSpec TimeZoneopt =>
TimeSpecWithOptionalTimeZoneNotAmbiguous =>
TimeSpecWithOptionalTimeZoneNotAmbiguous Calendaropt =>
CalendarTime  =>
TemporalTimeString 

Therefore 
13.37 ParseTemporalTimeString ( isoString )

https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaltimestring
will succeess in 2. If parseResult is a List of errors, throw a RangeError exception.
but the in step 3
3. If parseResult contains a UTCDesignator Parse Node, throw a RangeError exception.

the "Z" is UTCDesignator so it will throw RangeError.
2022-09-15 11:23:41 -07:00
Philip Chimento 0bc0ca189d Temporal: Fix test that depends on pre-1970 time zone data
Due to the TZDB's recent merging of time zones whose pre-1970 data was
different but post-1970 have been the same, this test is going to start
failing on implementations with up-to-date time zone data (because the
Europe/Amsterdam time zone was absorbed into Europe/Brussels in the latest
update.)

It's on our to-do list to remove all dependencies on IANA time zones from
the Temporal tests in staging/,
(see https://github.com/tc39/test262/issues/3649#issuecomment-1232326175)
but this one is more urgent.
2022-09-14 18:06:40 +02:00
Philip Chimento dc1dc28aa4 Add tests for proposal-resizable-arraybuffer to staging
These are tests for the Resizable ArrayBuffer proposal:
https://tc39.es/proposal-resizablearraybuffer/

These tests were automatically converted from V8's tests for the
proposal:
https://source.chromium.org/chromium/chromium/src/+/main:v8/test/mjsunit/typedarray-resizablearraybuffer.js
and subsequently edited by hand to fix things that couldn't be converted
automatically.
2022-09-08 11:49:06 -07:00
Aditi 747bed2e8a Add intl in staging directory 2022-08-11 15:41:01 -07:00
Aditi 6a99a28dd8 Add proposal-temporal's old demitasse tests to staging 2022-08-09 11:44:54 -07:00
Ms2ger 66ecafff2b Add proposal-temporal's Temporal.Instant tests to staging
Now that we have a staging directory, we can add the old-style tests from
proposal-temporal and avoid having to sync PRs across two repositories
when we convert them to test262 style.

Ms2ger wrote a script to convert them to be executable with the test262
harness, and this is the result of running that script on the remaining
Temporal.Instant tests in proposal-temporal.

More tests of other Temporal types to follow.
2022-08-04 16:20:26 -07:00