Commit Graph

15 Commits

Author SHA1 Message Date
Philip Chimento ff62561247 Ensure tests in main suite do not use Intl time zones
This requires a few adjustments of time zone names and offsets in some
places. The only named time zone that is required to be supported by an
implementation not supporting ECMA-402 is "UTC".
2022-01-19 13:47:43 -05:00
Philip Chimento 9c5ec87dba Test ISO strings with multiple fractional second parts
Tests for the normative changes made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1796
2021-12-14 13:39:19 -05:00
Jesse Alama 0b8319355b Test `since` for PD(T) with `largestUnit` = `year`, `month`
Nails down intended behavior of `PlainDate` and
`PlainDateTime`'s `since` that is already true in the
polyfill but which was specified in a buggy way (and hence
potentially not true in an implementation of Temporal).
Add similar tests for Instant, PlainTime, PlainYearMonth, and
ZonedDateTime.

Reference:
https://github.com/tc39/proposal-temporal/pull/1881
2021-12-14 13:39:19 -05:00
Justin Grant 6c2884eb9e Verify that `Temporal.*.prototype` isn't writeable 2021-12-14 13:38:14 -05:00
Frank Tang 970865e44d Rename to returns-string.js 2021-12-06 09:12:27 -05:00
Frank Tang 78907d6393 Move toLocaleString testing to intl402
Move part of the test of toLocaleString which depends on
15 Amendments to the ECMAScript® 2021 Internationalization API Specification
to intl402. Keep behavior specified in earlier chapters in built-ins
2021-12-06 09:12:27 -05:00
Philip Chimento 1d09acaac1 Fix not-callable getOffsetNansecondsFor tests
Unfortunately, in #3304 I made a last-minute mistake when I added the
uncallable value to the assertion message, and neglected to test it;
Symbols can't be converted to strings like that, so these tests would
fail. This fixes the assertion messages.
2021-11-30 14:36:59 -05:00
Philip Chimento cba42e88c7 Tests for string shorthand API in round() and total()
Tests for the normative changes made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1875

For convenience, adds some functions to TemporalHelpers to assert that two
Temporal objects are equal, for Duration, Instant, PlainDateTime,
PlainTime, and ZonedDateTime.
2021-11-16 17:06:06 -05:00
Philip Chimento ae53326189 Test TypeError is thrown when getOffsetNanosecondsFor is not callable
Tests for the normative changes made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1829
In a previous version of the specification, there was a fallback to the
intrinsic getOffsetNanosecondsFor when it was undefined.
2021-11-16 17:06:06 -05:00
Philip Chimento 3dbf940c9b Test removal of sub-minute time zone offsets in ISO strings
Tests for the normative changes made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1871
2021-11-01 14:07:02 -04:00
Philip Chimento 0dec11d949 Test positive and negative offset time zones in FormatTimeZoneOffset
Tests for the normative change made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1833
2021-11-01 14:07:02 -04:00
Mike Pennisi fd8d520cab Correct test for Temporal.Instant#toString
Prior to this patch, the modified test invoked the `arrayContains`
utility function without referencing its return value. Unlike Test262's
assertion functions, `arrayContains` does not throw an error when the
expectation is violated, so the prior usage did not influence test
results.

Additionally, the prior version of this test documented incorrect
expectations regarding the expected value produced by the method under
test. Due to the above, these expectations were not enforced.

Correct the test's expectations and enforce those expectations with a
function that will reliably produce an exception if violated.
2021-10-29 15:15:57 -04:00
Frank Tang adce88e717 mv tests depend on Intl to intl402. 2021-10-08 14:30:06 -04:00
Philip Chimento 77a34cf93f Add Temporal tests
This copies over the tests that previously existed in the
tc39/proposal-temporal repository.

For context, see thread starting at:
https://github.com/tc39/test262/issues/3002#issuecomment-926234480

In service of https://github.com/tc39/test262/issues/3002
2021-10-01 14:30:12 -04:00
Philip Chimento 45a913c057
Add branding tests from Temporal (#3138)
Closes: #3137

Co-authored-by: Ms2ger <Ms2ger@igalia.com>
2021-08-11 12:31:23 -07:00