529 Commits

Author SHA1 Message Date
Ms2ger
405f4fac4b Test PlainYearMonth.compare. 2022-02-01 17:58:30 -05:00
Ms2ger
6ba72412ab Test PlainYearMonth.prototype.with. 2022-02-01 17:58:30 -05:00
Ms2ger
7215b9387f Remove duplicated tests for PlainYearMonth.from overflow.
This is covered in overflow-wrong-type.js.
2022-02-01 17:58:30 -05:00
Ms2ger
dff7c70254 Avoid unrelated invalid input in PlainDate.from test. 2022-01-28 13:17:31 -05:00
Ms2ger
158d0bf35f Test PlainYearMonth constructor, from. 2022-01-28 13:17:31 -05:00
Ms2ger
543c8ee938 Pass arguments in PlainYearMonth constructor test.
The arguments are required, so this should make the test more robust.
2022-01-28 13:17:31 -05:00
Ms2ger
d86b913c11 Test Temporal.Now. 2022-01-24 13:36:43 -05:00
Ms2ger
4eb14032ae Basic tests for PlainDate#{add,subtract}. 2022-01-24 13:35:39 -05:00
Ms2ger
f768a24ab6 Test singular units in PlainDate#{add,subtract}. 2022-01-24 13:35:39 -05:00
Ms2ger
00b9691218 Test overflow 'constrain' in PlainDate#{add,subtract}. 2022-01-24 13:35:39 -05:00
Ms2ger
a042241ed2 Test overflow 'reject' in PlainDate#{add,subtract}. 2022-01-24 13:35:39 -05:00
Ms2ger
ef0b1507fc Test balancing in PlainDate#{add,subtract}. 2022-01-24 13:35:39 -05:00
Ms2ger
3fd429b231 Test PlainDate#{add,subtract}. 2022-01-24 13:35:39 -05:00
Ms2ger
3dfc587f36 Test PlainDate#{since,until}. 2022-01-24 13:35:39 -05:00
Ms2ger
a46aecc12a Test PlainDate.from with more objects. 2022-01-24 13:35:39 -05:00
Ms2ger
6bf7d8207a Test functions as options in PlainDate.from. 2022-01-24 13:35:39 -05:00
Ms2ger
b81ce78746 Test PlainDate.from with a number. 2022-01-24 13:35:39 -05:00
Ms2ger
4ec469c68c Test PlainDate.from with various strings. 2022-01-24 13:35:39 -05:00
Ms2ger
6f689c6c19 Rename PlainDate/from/argument-string.js. 2022-01-24 13:35:39 -05:00
Ms2ger
6ee33f1c86 Test PlainDate.from with trailing junk in string argument. 2022-01-24 13:35:39 -05:00
James Wright
e87b0048c4 Include missing semicolons in Temporal tests. 2022-01-19 13:48:03 -05:00
Philip Chimento
17b3c567ff Add more variations of ISO strings to "timezone-string-datetime" tests
Some of these tests have a larger variation of valid ISO strings that they
test, and others don't. Use the larger variation across all of these
files.
2022-01-19 13:47:43 -05:00
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
6058710478 Improve various assertion messages 2022-01-19 13:47:43 -05:00
Philip Chimento
dcf184a0ee Minor formatting fix 2022-01-19 13:47:43 -05:00
Frank Yung-Fong Tang
9bfdf89edc Fix incorrect argument
2nd argument of TemporalHelpers.assertPlainDate is year, not Temporal.PlainDate object.
2022-01-07 13:14:27 -05:00
Ms2ger
7bfda9f10b Add tests for overflow in PlainDate.from(). 2022-01-04 09:26:28 -05:00
Ms2ger
aa77abd928 Add tests for limits in PlainDate. 2022-01-04 09:26:28 -05:00
Ms2ger
88f2eb7329 Add a test for PlainDateTime#toPlainDate(). 2022-01-04 09:26:28 -05:00
Ms2ger
83bffcc6fd Add a test for PlainMonthDay#toPlainDate(). 2022-01-04 09:26:28 -05:00
Ms2ger
3f88250aca Add a test for PlainYearMonth#toPlainDate(). 2022-01-04 09:26:28 -05:00
Ms2ger
439ac8c2dc Add tests for PlainDate.compare(). 2022-01-04 09:26:28 -05:00
Ms2ger
78b8f7945c Add tests for PlainDate#equals(). 2022-01-04 09:26:28 -05:00
Ms2ger
0855621088 Add tests for PlainDate#toString(). 2022-01-04 09:26:28 -05:00
Philip Chimento
af00d69c39 Some progress on not using time zone names that require Intl
In order to test this functionality on hosts that don't have Intl, we have
to use "UTC" and offset-only time zones here, as the full set of IANA time
zone names are not required to be supported across all hosts.

This makes some progress on https://github.com/tc39/test262/issues/3253
2021-12-14 13:46:13 -05:00
Philip Chimento
e3395bb1e4 Fix some copy-paste errors 2021-12-14 13:46:13 -05:00
Philip Chimento
5e9da36a2f Bring formatting in line with other tests
Other tests similar to these were changed to use a for-of loop, so do the
same here.
2021-12-14 13:46:13 -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
Jesse Alama
85973b35e4 Rendering Duration with negative components
A rendered Duration that was constructed with negative
componented begins with a `-`, but that's the last
time a minus sign appears.
2021-12-14 13:39:19 -05:00
Philip Chimento
8d025ef1d6 Test that non-undefined, non-zoned relativeTo parameters are converted to PlainDate
Tests for the normative changes made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1873

This adds a new Temporal helper calendar that asserts that its dateAdd()
method is always called with a PlainDate instance. This allows testing
that relativeTo parameters are always converted to PlainDate if they are
not ZonedDateTime and not undefined. Prior to the normative PR, they
would be converted to PlainDateTime instead.

Additionally and optionally, the helper calendar can also assert that its
dateAdd() method is called with a specific PlainDate instance. This allows
testing that the instance is the same PlainDate passed as the relativeTo
parameter (in the case of Duration methods) or is the receiver (in the
case of PlainDate methods). For the PlainDateTime and PlainYearMonth
methods the PlainDate instance is synthesized internally so there is no
need to assert that dateAdd() is called with a specific instance.
2021-12-14 13:39:19 -05:00
Philip Chimento
0184842b09 Test rejection of "Z" UTC designators in Plain strings
Tests for the normative changes made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1874
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
Frank Yung-Fong Tang
46f165ae49 change not-required timezone id to required UTC 2021-12-02 09:46:33 -05:00
Frank Yung-Fong Tang
254c3107ab Replaced not required timezone id w/ required UTC 2021-12-02 09:46:33 -05:00
Frank Yung-Fong Tang
f801aa9468 add back UTC timezone 2021-12-02 09:46:33 -05:00
Frank Yung-Fong Tang
2808c07dc5 Move all tests which have IANA timezone to intl402 2021-12-02 09:46:33 -05:00
Frank Yung-Fong Tang
2576b650af fix the checking 2021-12-02 09:46:33 -05:00