Commit Graph

2523 Commits

Author SHA1 Message Date
Philip Chimento ddef61a106 Temporal: Deduplicate strings-with-calendar from strings-without-calendar
The strings with calendar annotations in these tests don't need to be
listed separately, they can be derived from the original strings.
2022-08-31 08:59:33 -07:00
Philip Chimento 409d6dc71a Temporal: Add tests for PlainTime string disambiguation with calendar
This implements the normative change in
https://github.com/tc39/proposal-temporal/pull/2287 which reached
consensus at the July 2022 TC39 meeting.

It adds tests that ensure that PlainTime strings which require a T
designator for disambiguation, are not disambiguated by adding a calendar
annotation.
2022-08-31 08:59:33 -07:00
Philip Chimento d8e8529e8d Temporal: Add tests for PlainTime string disambiguation with time zone
This implements the normative change in
https://github.com/tc39/proposal-temporal/pull/2284 which reached
consensus at the July 2022 TC39 meeting.

It adds tests that ensure strings like HHMM-UU[TZ] and HHMMSS[TZ] do not
require a disambiguating T separator, even if HHMM-UU and HHMMSS would by
themselves.
2022-08-31 08:59:33 -07:00
Aditi 8dcc0e1955 Add calendar strings to instant string tests 2022-08-25 10:14:30 -07:00
Philip Chimento c4daf3ef74 Temporal: Add test for rounding Duration relative to Feb 1 in a leap year
This implements the normative change in
https://github.com/tc39/proposal-temporal/pull/2344 which reached
consensus at the July 2022 TC39 meeting.

It adds a test that catches a corner case in Duration.prototype.round().
2022-08-11 12:57:37 -07:00
Kevin Gibbons adba7dfd9c fix order 2022-08-09 12:15:49 -07:00
Kevin Gibbons 418419a345 add non-matching example 2022-08-09 12:15:49 -07:00
Kevin Gibbons 52284ba4bb add tests for proposal-duplicate-named-capturing-groups 2022-08-09 12:15:49 -07:00
Philip Chimento d45766bef3 Add cases to RegExp.prototype flags brand checking tests
For completeness, as we are doing in newer brand checking tests such as
those of Temporal, call these getters with a function object and a bigint
as the receiver.

Suggested in https://github.com/tc39/test262/pull/3614/files#r929662337
2022-08-09 12:07:36 -07:00
Richard Gibson 9e51a9d855 Update RegExp.prototype.{match,replace} tests to expect Get(rx, "flags")
Ref https://github.com/tc39/ecma262/pull/2791
2022-08-09 12:02:45 -07:00
Linus Groh 0f35848794 ShadowRealm: Relax requirements of globalThis available properties test
The intention of this test is to ensure that all built-in properties of
the global object are also exposed on the ShadowRealm's global object,
without penalizing implementations that don't have all of them
implemented.
Notably, SharedArrayBuffer may still not be (re-)enabled in all
circumstances.
2022-08-04 20:37:23 +02:00
Aditi e9f424b6fc Remove duplicate timezone tests 2022-08-04 11:03:46 +02:00
Yusuke Suzuki f74cee5f59 Rename Array#groupBy and Array#groupByToMap to Array#group and Array#groupToMap
TC39 decided to rename them to avoid web-compat issue[1].
This change follows to it.

[1]: https://github.com/tc39/proposal-array-grouping/pull/39
2022-08-03 13:29:11 -07:00
Philip Chimento 10a5c4f784 Temporal: Adjust and expand tests for observable calls to ToString(calendar)
This implements the normative change in
https://github.com/tc39/proposal-temporal/pull/2269 which reached
consensus at the July 2022 TC39 meeting.

There was already a test for PlainDate for this topic, which needs to be
adjusted to accommodate the normative change. Tests for PlainDateTime and
ZonedDateTime did not yet exist, so add new ones based on the PlainDate
test.
2022-08-03 14:23:40 +02:00
Kevin Gibbons 4c0322569c add tests for "only coerce once in BigInt constructor" 2022-08-02 18:17:20 -07:00
André Bargull 5d3d39ee16 Remove tests which use negative day lengths
There are already tests to reject negative day lengths, so we can simply
remove these other tests.

Also remove a misleading comment ("Test negative divisor"), because the
test following the comment actually uses a positive divisor.
2022-08-01 14:13:30 -07:00
André Bargull 30091032c1 Import SpiderMonkey Temporal tests
Temporal tests written for the SpiderMonkey implementation. Mostly
covers edge cases around mathematical operations and regression tests
for reported spec bugs.
2022-08-01 14:13:30 -07:00
Philip Chimento 6685c6c81c Temporal: Add tests for casting a calendar ID string to a Temporal.Calendar
This adds tests to every entry point where a Temporal.Calendar is
accepted, making sure that a calendar ID string is also accepted.
2022-08-01 13:48:11 -07:00
Philip Chimento bc0e006de4 Temporal: Add tests for casting a time zone ID string to a Temporal.TimeZone
This adds tests to every entry point where a Temporal.TimeZone is
accepted, making sure that a time zone ID string is also accepted.
2022-08-01 13:48:11 -07:00
Philip Chimento 6b5297a142 Temporal: Add tests for invalid strings as values of 'offset' property
(...in property bags; the 'offset' option in an options object already has
tests)
2022-08-01 13:48:11 -07:00
Aditi f932f079b3 Add test for Temporal.Duration.prototype.total 2022-08-01 09:59:27 -07:00
Aditi b37d74191a Add tests for wrong argument type in Temporal.TimeZone 2022-08-01 09:56:22 -07:00
Philip Chimento e48df0b964 Temporal: Adjust tests for non-integer/out-of-range values of fractionalSecondDigits
This implements the normative change in
https://github.com/tc39/proposal-temporal/pull/2297 which reached
consensus at the July 2022 TC39 meeting.

Values given as the fractionalSecondDigits option are now truncated to
integers before they are compared to the allowable range.
2022-07-29 15:05:41 -07:00
Aditi 6fa1bb89a3 Added tests for an empty or a function options object 2022-07-28 11:59:50 -07:00
André Bargull bea421c1dc Update tests which used negative day lengths
Negative day lengths are no longer valid after
<https://github.com/tc39/proposal-temporal/pull/2261>.
2022-07-27 08:48:49 -07:00
Mathias Bynens e623dd7a11
Add manually written tests for RegExp `v` flag proposal (#3614)
https://github.com/tc39/proposal-regexp-v-flag

Issue: #3496, https://github.com/tc39/proposal-regexp-v-flag/issues/52

Add more tests for the new RegExp `v` flag

Add test for combination of `u` and `v` flag
2022-07-26 10:42:06 -07:00
Philip Chimento 75c877e5ca Temporal: test for out-of-range in Temporal.PlainMonthDay constructor
The refISOYear argument in the Temporal.PlainMonthDay constructor can
cause a RangeError if it is outside the supported range for PlainDate.

This is part of a normative PR that reached consensus at the July 2022
TC39 plenary:
https://github.com/tc39/proposal-temporal/pull/2266
2022-07-25 13:34:08 -07:00
Zirak c665ccea28 Test primitive retval of Iterator and AsyncIterator getters
The existing test passed an object for a `this` value. This commit checks that
primitive values are returned verbatim, without any conversion.

Resolve #3489.
2022-07-25 13:32:57 -07:00
Aditi dadf18f416 Add tests for temporalDurationLike argument and improve existing tests 2022-07-25 13:30:46 -07:00
snek 6833180066 add SharedArrayBuffer feature to test 2022-07-22 07:04:58 -07:00
André Bargull a3040a5047 Import SpiderMonkey Temporal tests
Temporal tests written for the SpiderMonkey implementation. Mostly
covers edge cases around mathematical operations and regression tests
for reported spec bugs.
2022-07-19 11:30:43 -07:00
Mathias Bynens 67160e94a9 Remove duplicate entries from `nonMatchStrings`
https://github.com/mathiasbynens/unicode-property-escapes-tests/pull/12
2022-07-12 19:21:53 -07:00
Mathias Bynens 33ea5b6439 Move folder around 2022-07-12 19:21:53 -07:00
Mathias Bynens d361217eb7 Add tests for RegExp set notation
Set notation and extended character class functionality is part of the RegExp `v` flag proposal: https://github.com/tc39/proposal-regexp-set-notation

Issue: https://github.com/tc39/test262/issues/3496, https://github.com/tc39/proposal-regexp-set-notation/issues/52
2022-07-12 19:21:53 -07:00
Ms2ger b8d4c12698 Temporal: Add test for custom fields in PlainDate.from. 2022-07-11 13:40:24 -07:00
Aditi caaeb2bc90 Replace %%%conversion_target%%% with PlainDate 2022-07-11 15:32:23 +02:00
Ms2ger 3ddfa0cd13 Temporal: Test that Calendar#dateAdd is called with the correct arguments. 2022-07-04 11:30:02 -06:00
dnalborczyk 1b3bddbeff Fix spelling in test description 2022-07-04 09:40:40 +02:00
Philip Chimento 704c9cea9c Temporal: Test validation of overflow option for conversion fast paths
A normative change that reached consensus at the June 2022 TC39 meeting
was this small change to throw on an invalid value for the overflow option
in PlainDate.from() and PlainDateTime.from(), in the case of a fast-path
conversion.

See https://github.com/tc39/proposal-temporal/pull/2225
2022-07-01 10:29:18 +02:00
Philip Chimento f6179a6eb6 Temporal: Test observable calendar.mergeFields() calls with null-prototype objects
As of https://github.com/tc39/proposal-temporal/pull/2219 the arguments to
the calendar.mergeFields() methods should be null-prototype objects when
called from with() and toPlainDate() methods. This adds tests for that
behaviour.
2022-06-27 13:51:58 +02:00
Philip Chimento f314ecb9f4 Temporal: Test observable calls on fields object from PrepareTemporalFields
As of https://github.com/tc39/proposal-temporal/pull/2219 the object
returned from the PrepareTemporalFields abstract operation should be a
null-prototype object. There are a number of places where this is
observable in one of the calendar's ...FromFields() methods. This adds
tests for this behaviour everywhere it is observable.
2022-06-27 13:51:58 +02:00
Philip Chimento ca74e801b2 Temporal: Test observable calendar.yearMonthFromFields() calls with null-prototype options
As of https://github.com/tc39/proposal-temporal/pull/2219 PlainYearMonth's
add() and subtract() methods should be calling the calendar's
yearMonthFromFields() method with a null-prototype object as the options
parameter, due to the change in
AddDurationToOrSubtractDurationFromPlainYearMonth. This adds a test for
this behaviour.
2022-06-27 13:51:58 +02:00
Philip Chimento 0c33b09337 Temporal: Test observable calendar.dateUntil() calls with null-prototype options
As of https://github.com/tc39/proposal-temporal/pull/2219 since() and
until() methods should be calling the calendar's dateUntil() method with a
null-prototype object as the options parameter, due to the change in
MergeLargestUnitOption. This adds a test for this behaviour.
2022-06-27 13:51:58 +02:00
Ms2ger 5e564b96e7 Temporal: Fix typo in description. 2022-06-25 19:56:03 +02:00
Ms2ger 079a7eac7a Temporal: Fix typo in ZonedDateTime/from/offset-wrong-type.js. 2022-06-25 19:55:37 +02:00
Ms2ger 8123e8fc34 Temporal: Add missing Number checks in overflow-wrong-type.js. 2022-06-25 19:54:57 +02:00
Philip Chimento babd46c40a Add tests for Temporal.Instant strings at the edge of the range
This adds tests for a normative change which reached consensus in the June
2022 TC39 meeting, ensuring that the representable range of
Temporal.Instant is always the same regardless of which time zone offset
is used when converting from a string.

See: https://github.com/tc39/proposal-temporal/pull/2189
2022-06-22 09:28:14 +02:00
Ms2ger 81836ba124
Temporal: Test PlainDate#{add,subtract} with custom calendar. 2022-06-21 16:26:58 +02:00
Ms2ger b1020c50b7
Temporal: Extend PlainDate#toPlainDateTime coverage. (#3582) 2022-06-20 07:33:59 -07:00
Ms2ger 65e75e4eed
Temporal: Extend PlainDate#{since,until} coverage. (#3581) 2022-06-20 06:47:09 -07:00
Ms2ger d5b2c706cf Update test/built-ins/Temporal/PlainDate/prototype/with/custom.js 2022-06-20 15:30:02 +02:00
Ms2ger 8eadab4d0b Update test/built-ins/Temporal/PlainDate/prototype/with/custom.js 2022-06-20 15:30:02 +02:00
Ms2ger bdd4bfa619 Update test/built-ins/Temporal/PlainDate/prototype/with/calendar-invalid-return.js
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2022-06-20 15:30:02 +02:00
Ms2ger 1a9f64cda3 Temporal: Extend PlainDate#with coverage. 2022-06-20 15:30:02 +02:00
Ms2ger 9762bc991f Temporal: Make branding tests more robust. 2022-06-20 13:14:35 +02:00
Ms2ger 080e893e21 Temporal: Standardize branding tests. 2022-06-20 13:14:35 +02:00
Ross Kirsling a3f09ea074 Temporal: Add missing feature flag for prototype.constructor tests. 2022-06-17 09:15:47 +02:00
André Bargull f169ba6ec7 Add tests for TemporalInstantString with bracketed time zone annotation 2022-06-16 15:03:30 +02:00
Ms2ger b1f49b5c46 Update test/built-ins/Temporal/PlainDate/compare/argument-zoneddatetime.js
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2022-06-14 16:45:56 +02:00
Ms2ger 820461ef4b Temporal: Extend tests for PlainDate.compare. 2022-06-14 16:45:56 +02:00
Philip Chimento ee7055121d Temporal: Add tests for invalid Temporal.Instant strings
This adds tests to all entry points where an ISO string is converted to a
Temporal.Instant. The tests exercise various invalid ISO strings to make
sure that they throw a RangeError.
2022-06-14 15:56:06 +02:00
Philip Chimento 0e86baf6f3
Temporal: Add tests for order of observable operations in *FromFields methods (#3568)
This adds tests for https://github.com/tc39/proposal-temporal/pull/2203
which was a normative change that reached consensus in the June 2022 TC39
plenary meeting.

Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2022-06-14 15:46:16 +02:00
Ms2ger 697784363f Temporal: Add toZonedDateTime tests. 2022-06-13 17:57:54 +02:00
Ms2ger 6f2e6872fb
Temporal: Extend tests for getISOFields. (#3560) 2022-06-13 08:55:55 -07:00
Ms2ger 98b76ef533 Temporal: Extend tests for PlainDate#toPlainMonthDay. 2022-06-13 17:52:34 +02:00
Ms2ger e6b7323614 Temporal: Extend tests for PlainDate#toPlainYearMonth. 2022-06-13 17:51:29 +02:00
Ms2ger 3812a1fe92 Temporal: Extend tests for PlainDate#toString. 2022-06-13 16:47:22 +02:00
Ms2ger 194f7426f9 Temporal: Add basic test for PlainDate#toJSON. 2022-06-13 16:45:42 +02:00
Ms2ger f9a5a8b29c Temporal: Extend test for withCalendar. 2022-06-13 16:38:07 +02:00
Ms2ger 56ed1a0f82 Temporal: Test custom calendar operations. 2022-06-13 16:37:06 +02:00
Ms2ger da19e0a50c Temporal: Add some Instant string tests. 2022-06-13 16:29:52 +02:00
Ms2ger 267aab37c2 Temporal: Add missing valueOf tests. 2022-06-13 16:27:28 +02:00
Ms2ger bb926a1796 Temporal: Extend tests for daysInMonth. 2022-06-13 16:26:08 +02:00
Ms2ger 3343e15083 Temporal: Test daysInWeek when the week spans across years. 2022-06-13 16:24:44 +02:00
André Bargull b2f7dc1194 Expect precise result for negative fractional units
Fixes #3544
2022-06-08 17:04:45 +02:00
André Bargull c61a04fd88 AddDurationToOrSubtractDurationFromPlainYearMonth doesn't add "month" to calendar fields
Fixes #3546
2022-06-08 17:02:33 +02:00
Ms2ger 53d6cd6d46 Temporal: Add tests for converting a ZonedDateTime to a PlainDate. 2022-06-02 08:50:05 +02:00
Iban Eguia Moraza 53df4bc69a
Fixed #3545 2022-05-31 16:28:31 +02:00
Ms2ger f7b626133d Temporal: Add tests for prototype.constructor. 2022-05-26 10:34:10 +02:00
Ms2ger ed5ada3e13 Temporal: Improve coverage for PlainDate constructor and from(). 2022-05-25 11:39:05 -07:00
Ms2ger 1aeed72ab5 Temporal: Add arguments to constructor tests. 2022-05-25 11:35:10 -07:00
Ms2ger 6573cf954b Temporal: Add tests that subclass constructors work. 2022-05-25 11:23:22 -07:00
Ms2ger 2c8e4c061b Temporal: Cleanup some tests.
The options-invalid.js tests were also covered by options-wrong-type.js.

The tests for add/subtract without an options argument were also covered by options-undefined.js.
2022-05-25 11:10:04 -07:00
Ms2ger 63cf9ba7b5 Temporal: Extend tests for daysInYear and inLeapYear. 2022-05-24 10:56:45 -07:00
Philip Chimento 579268ab79 Temporal: Add tests for variant time separators
ISO strings may separate the time from the date with a case-insensitive T,
or a space. This adds tests to all entry points that take ISO strings, to
ensure that they accept an uppercase T, lowercase T, or space as the time
separator.

These tests are based on the one test for Temporal.PlainDateTime.from that
was already present.
2022-05-23 11:47:56 +02:00
Ms2ger 7fca6637e9 Temporal: Extend toJSON/toString tests. 2022-05-20 09:32:52 -07:00
Ms2ger 2de2fe3084 Temporal: Ensure PlainTime branding tests fail if needed. 2022-05-20 14:20:43 +02:00
Ms2ger 7960d616cf Temporal: Add a test for PlainTime#toZonedDateTime. 2022-05-19 12:55:27 -07:00
Ms2ger a1a5c91543 Temporal: Add a test for PlainTime#calendar. 2022-05-19 12:54:14 -07:00
Ms2ger b8ab7063b0 Temporal: Add tests for PlainTime#{toJSON/toString}. 2022-05-19 12:23:43 -07:00
Ms2ger 912559f683 Temporal: Test @@toStringTag properties. 2022-05-19 12:20:15 -07:00
Ms2ger 494b678cc5 Temporal: Add tests for ZonedDateTime to PlainDate conversion.
Also rename leap second tests for consistency.
2022-05-18 12:35:07 -07:00
Chengzhong Wu 509363bcfd
Add test on handling broken promises in AsyncGenerator.prototype.return (#3472)
* Add test on handling broken promises in AsyncGenerator.prototype.return

* fixup!

* fixup!
2022-05-12 14:28:33 -04:00
legendecas d6b5b1358c ShadowRealm: exportName is no longer be coerced to a string 2022-05-05 17:03:33 -04:00
Jordan Harband 00263bf90f add missing Reflect.construct feature 2022-05-05 17:13:25 +02:00
Philip Chimento 2a03068b84 Fix Temporal.PlainDateTime.withPlainDate tests
I suggested in #3517 that these lines should be removed but didn't realize
they must be present because TemporalHelpers.assertPlainDateTime is going
to check the 'era' and 'eraYear' properties.
2022-05-05 09:51:01 +02:00
Philip Chimento a44a97a09a Add reference ISO days to PlainYearMonth assertions
I missed adding these in 27f0104bc6
2022-05-04 10:15:19 +02:00
Frank Yung-Fong Tang 06fafd794b
Move testing of era/eraYear under intl402 (#3517)
* Move testing of era/eraYear under intl402

* remove era/eraYear from built-in tests.
2022-05-03 11:11:20 -07:00
Ms2ger 7099acc882 Temporal: Add some tests for Duration#round.
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2022-05-03 08:15:56 -07:00
Ms2ger 69fd39b463 Temporal: Add some Duration#{add,subtract} tests. 2022-05-03 08:15:56 -07:00
Philip Chimento 8e0e2592d3 Expand Duration.compare test
This adds coverage for the situation where we get a different answer from
Temporal.Duration.compare depending on whether relativeTo resolves to a
PlainDate or ZonedDateTime.

See discussion in
https://github.com/tc39/test262/pull/3505#discussion_r859994610
2022-05-03 08:18:02 +02:00
Philip Chimento 65a7ace1cb Regularize year zero tests
Some of these strings wouldn't have been valid even with a valid year in
them (e.g. strings ending in +01:00[UTC]) so fix up the strings that we
test. While touching these tests, I took the opportunity to regularize
them, and add some missing ones for ISO strings that convert to Calendar
and TimeZone.
2022-05-03 08:18:02 +02:00
Philip Chimento 020faf5c7a Temporal: fix property bag order
No big deal, this was just bothering me that I wrote timeZone before
calendar in most of the tests, and vice versa in only a few.
2022-05-03 08:18:02 +02:00
Philip Chimento 88a4cf4af7 Temporal: Use some constructors directly
Be consistent about creating Temporal objects for use in tests with direct
constructor calls, instead of relying on string coercions. This reduces
coupling in the tests.
2022-05-03 08:18:02 +02:00
Philip Chimento 078f3e22a4 Regularize leap second tests
Everywhere an ISO string is accepted in Temporal, a seconds value of :60
should always be coerced to :59, because of how leap seconds are handled
in ISO strings.

In property bags, a 'seconds: 60' property is not subject to that rule: it
should be handled according to the overflow option if there is one.

These tests existed already for some types; regularize them and add the
ones that didn't exist yet.
2022-05-03 08:18:02 +02:00
Philip Chimento 27f0104bc6 Regularize Temporal.*.from() object cloning tests
Each from() method except Calendar and TimeZone should test that when you
pass an instance of that type, the return value is a clone of that
instance, and a distinct object.

These tests existed already for some types; regularize them and add the
ones that didn't exist yet.

In order to test the referenceISODay of a PlainYearMonth we add an
argument to TemporalHelpers.assertPlainYearMonth.
2022-05-03 08:18:02 +02:00
Ms2ger b649e6b22a Temporal: Port some Duration.compare tests. 2022-04-29 10:58:05 -07:00
Jesse Alama dcd25e616d Temporal: Port Demitasse tests for `PlainDateTime`'s `toString` 2022-04-28 12:20:22 +02:00
Jordan Harband 28b31c0bf1 use `isConstructor` assertion in "non-constructor" tests 2022-04-27 12:23:50 -04:00
Ms2ger 7f2668f807 Temporal: Port a few tests for Duration#{add,subtract}. 2022-04-27 09:31:33 +02:00
Jesse Alama d156a5a63f Temporal: Port `PlainDateTime`'s Demitasse `withCalendar` tests
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2022-04-26 10:11:11 +02:00
Ms2ger 8f5c7aed09 Temporal: Fix bug in PlainDateTime/prototype/toZonedDateTime/basic.js. 2022-04-25 11:36:56 -04:00
Philip Chimento 8a1ec2f20b Test ISO strings with extended year -000000
In Date.parse() and new Date(), representations of the year 0 as -000000
must not be accepted. In the case of Date.parse(), they should yield NaN,
and in the case of new Date(), they should yield an invalid Date object,
whose valueOf() is NaN.
2022-04-25 11:34:52 -04:00
Jesse Alama 1b71018adb Temporal: `PlainDateTime`: Port Demitasse tests for bounds 2022-04-25 12:22:49 +02:00
Jesse Alama cba02351f8 Temporal: Port Demitasse tests for PlainDateTime toZonedDateTime 2022-04-25 12:16:46 +02:00
Ms2ger efcac4c05a Temporal: Port some Duration tests. 2022-04-25 11:07:11 +02:00
Philip Chimento 78c6ec7f1c Test wrong types in conversions to Temporal types
These tests cover, for every API entry point where a Temporal object is
expected, what happens when a value of a different type is passed in that
can't be converted.

Most entry points can convert a string to the expected Temporal type, and
will do ToString on any non-Object argument, and throw RangeError if the
result isn't a string that's convertible to that Temporal type. ToString
will throw TypeError on a Symbol.

Most entry points also take a property bag, and will throw TypeError if
the property bag doesn't have the required properties.

We also have to test for TimeZone and Calendar what happens if the wrong
type is provided as the value of a 'timeZone' or 'calendar' property in
another property bag, up to one level of nested properties.
2022-04-21 12:14:10 -07:00
Philip Chimento afce1b3fde Test conversion of Number to Temporal objects
Adds tests for conversion of a Number whose corresponding toString() value
is a valid ISO string. For some Temporal types this is possible, with a
number like 20220418.

Especially for Temporal.Calendar, we have to take into account the case
where the number is provided as the value for the 'calendar' property in a
property bag, and the case of up to one level of nested property bag as
well.

Regularizes and expands existing tests for this case.
2022-04-21 12:14:10 -07:00
Philip Chimento a38d3f3b67 Add missing test for Temporal.ZonedDateTime constructor
The test for a TimeZone created from an ISO string with multiple offsets
was missing from the Temporal.ZonedDateTime constructor, whereas it was
present for several other APIs. Add it.
2022-04-21 12:14:10 -07:00
Philip Chimento 7b3c176629 Add missing tests for PlainTime property bag with no time units
We already had similar tests to these for other methods, such as
Temporal.PlainTime.prototype.equals(). since() and until() should have
these tests too.

Update assertion messages in all of the existing tests as well, as per
Ms2ger's review comment.
2022-04-21 12:14:10 -07:00
Philip Chimento 15ed94c891 Test conversion of object to string in Temporal.Instant context
An object may be given in any context where a Temporal.Instant is expected
(see ToTemporalInstant). There is no conversion from a property bag to an
Instant, unlike with other Temporal types. Instead the object is converted
to a string, and if its toString() method yields a valid ISO string, the
conversion succeeds. (An object with the default Object.prototype.toString
will not.)
2022-04-21 12:14:10 -07:00
Philip Chimento d28ca991cb Test conversion of Temporal.Instant strings with sub-minute UTC offsets 2022-04-21 12:14:10 -07:00
Philip Chimento 9cd27beb12 Test basic functionality of Temporal.Instant.from 2022-04-21 12:14:10 -07:00
Philip Chimento 4fdb4ee52f Fix invocations of some Temporal methods
We should make sure that we are providing the correct arguments to these
methods even if they are supposed to throw; they should throw for the
reason we expect, and not because we provided the wrong arguments.
2022-04-21 12:14:10 -07:00
Philip Chimento c82e2782e6 Regularize some quotes
Some of the similar tests to these use double quotes, some use single.
2022-04-21 12:14:10 -07:00
Jesse Alama 089c74ce59 Temporal: Port `PlainDateTime`'s `from` tests 2022-04-19 11:13:01 -07:00
Philip Chimento b68c751f5b Replace deepEqual with compareArray
Here is one place where compareArray is better fit for purpose, because we
are comparing an array.
2022-04-19 12:16:03 -04:00
Jordan Harband f0bf5dfcea parseInt: fix description typo 2022-04-15 18:17:02 -04:00
Jordan Harband 4bbe20d52c add missing TypedArray feature 2022-04-15 18:17:02 -04:00
Jesse Alama 33a5433d1b Temporal: PlainDateTime: Port Demitasse `until` and `since` tests
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2022-04-15 10:49:18 -07:00
Ms2ger ff5af6fccf Temporal: Consolidate tests for invalid string argument to round(). 2022-04-15 10:12:19 -07:00
Shu-yu Guo 1c19242ae4 Remove check for per-iteration detach check in TypedArray.prototype.set
Note that this test currently unintentionally passes, because a
TypeError is thrown for failing to convert the undefined returned from
the getter to a BigInt. But since this test was intended to test
detaching, it's no longer valid and should still be removed.

See https://github.com/tc39/test262/pull/3465#issuecomment-1098388916
2022-04-13 21:24:57 -04:00
Ms2ger 4dafd2158b Temporal: Remove some stray arguments to TemporalHelpers.assertDuration. 2022-04-13 09:37:35 -07:00
Ms2ger c35ae2099d
Temporal: Some more tests for PlainDateTime#with. (#3481) 2022-04-13 09:31:57 -07:00
Philip Chimento d9616ed91f Add tests for direction of rounding functionality
The round() and toString() methods of Temporal.Instant, PlainDateTime, and
ZonedDateTime can round up or down. However, the instance must not be
treated as "negative" even when the time is before 1 BCE (years are
negative) or before the Unix epoch (epoch nanoseconds are negative). That
is, rounding down is always towards the Big Bang, and rounding up is
always away from it. Add tests that verify this.
2022-04-13 10:46:20 +02:00
Philip Chimento 3905c0c80a Expand toString() rounding tests from PlainTime to cover other types
This takes the tests of the rounding functionality of
Temporal.PlainTime.p.toString() and adds similar tests covering the
equivalent functionality to Duration, Instant, PlainDateTime, and
ZonedDateTime: all the types that have rounding and precision controls
for how they output their subsecond values.

It also takes the opportunity to improve the existing PlainTime tests:

- fractionalseconddigits-auto.js: More descriptive variable names. Added
  assertion messages.
- fractionalseconddigits-number.js: Ditto.
- rounding-cross-midnight.js: Use constructor directly to remove coupling
  with from().
- roundingmode-*.js: Add additional tests for specifying the precision
  using fractionalSecondDigits.
- smallestunit-fractionalseconddigits.js: Add assertion messages.
2022-04-13 10:46:20 +02:00
Philip Chimento 4ac16c2589 Add tests for Temporal options bags being of the wrong type
This consolidates the few existing tests for options bags in Temporal
being of the wrong type, and adds them for every entry point in Temporal
that accepts an options bag.

These are mostly identical tests, but there is a variation for methods
like round() where either an options bag or string is accepted.
2022-04-13 10:46:20 +02:00
Philip Chimento 9b2c98c02b Bring existing "invalid string" tests for smallestUnit and largestUnit in sync
Add a consistent set of invalid strings for all of the
smallestunit-invalid-string.js and largestunit-invalid-string.js tests:
- "era" and "eraYear" in singular and plural
- all of the units that are disallowed for that particular method call, in
  singular and plural
- an allowed unit with \0 at the end
- an allowed unit with an "i" replaced by a dotless i
- an allowed unit but with all-caps
- an unrelated string.
2022-04-13 10:46:20 +02:00
Philip Chimento b4c0aeda20 Bring existing toString options tests in sync with each other
Of the toString() methods that have options for printing a time with
seconds and fractional seconds, PlainTime seems to have the most
comprehensive set of tests. Bring all the others (Duration, Instant,
PlainDateTime, and ZonedDateTime) in sync with PlainTime, and edit the
PlainTime ones where necessary to include improvements from the others.

Tests:
  - fractionalseconddigits-invalid-string.js: copy and expand on
    PlainTime's more comprehensive set of invalid strings. Add assertion
    message. Fix front matter.
  - fractionalseconddigits-non-integer.js: Fix front matter.
  - fractionalseconddigits-out-of-range.js: make sure infinity is tested.
    Add assertion messages. Fix front matter.
  - fractionalseconddigits-undefined.js: copy PlainTime's more
    comprehensive test with whole minutes, whole seconds, and subseconds.
    Copy PlainTime's test of an empty function object. Add more
    descriptive variable names and assertion messages. Fix front matter.
  - fractionalseconddigits-wrong-type.js: inline and delete TemporalHelper
    used here; it was only good for this test anyway. Improve assertion
    messages.
  - smallestunit-valid-units.js: copy PlainTime's test with a second value
    with zero seconds even. Refactor repetitive tests into a loop. Copy
    the invalid unit "era" from the Instant test. Add assertion messages.
2022-04-13 10:46:20 +02:00
Ms2ger 2c880bf5c1 Temporal: Some more tests for PlainDateTime.compare. 2022-04-12 10:33:20 -07:00
Ms2ger a226601d12 Temporal: Some more tests for PlainDateTime#withPlainDate. 2022-04-12 10:10:04 -07:00
Ms2ger 7823be3e96 Temporal: Move test with typo in name. 2022-04-12 10:10:04 -07:00
Ms2ger 62e0130447
Temporal: Some more tests for PlainDateTime#equals. (#3479) 2022-04-12 10:02:53 -07:00
Jesse Alama 5f1aba63ee
Temporal: Port Demitasse PlainDateTime `round` tests (#3478)
Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2022-04-12 17:36:03 +02:00
rwaldron 9055521fc7 ShadowRealm: fix for incorrect test 2022-04-11 13:25:42 -04:00
Mike Pennisi d4ede37b67 Add assertions for functions with infinite length
A prior version of ECMA262 described invalid mathematical operations
with infinite values [1]. Update the test metadata to reflect the
corrected specification text, and add two assertions for the obsolete
conditions.

[1] ".bind on a function with infinite length has imprecise spec and
    engine divergences"
    https://github.com/tc39/ecma262/issues/2170
2022-04-11 13:12:42 -04:00
rwaldron 24e4eb09da ShadowRealm: add more tests for globalThis ordinary object conformance 2022-04-11 12:59:01 -04:00
Shu-yu Guo d7c0a2076c Remove check for per-comparator call detach check in TypedArray.prototype.sort
This updates tests in line with the normative change in
https://github.com/tc39/ecma262/pull/2723
2022-04-05 11:25:05 -04:00
Shu-yu Guo 3ac6b73369 Add test that TypedArray.prototype.set doesn't throw if a getter for an element detaches 2022-04-05 11:18:45 -04:00
Shu-yu Guo 8b29141224 Remove check for per-iteration detach check in TypedArray.prototype.set
This updates tests in line with the normative change in
https://github.com/tc39/ecma262/pull/2646
2022-04-05 11:18:45 -04:00
Philip Chimento 833a784f20 Tests for computing PlainYearMonth addition and subtraction in correct calendar space
https://github.com/tc39/proposal-temporal/pull/2003 is a normative change
that reached consensus at the March 2022 TC39 plenary meeting. This adds
tests that verify the new spec text is implemented correctly, performing
arithmetic on a PlainYearMonth instance that would previously have thrown
an error if it was implemented as written.
2022-04-04 16:58:09 -04:00
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
Shu-yu Guo 51822ff2d8 Update Symbol.species tests for TypedArray constructor
This updates tests in line with
https://github.com/tc39/ecma262/pull/2719
2022-04-04 16:52:23 -04:00
Philip Chimento da507a703e Tests for Temporal formatting the year appropriately as 4 or 6 digits
https://github.com/tc39/proposal-temporal/pull/2090 is a normative change
that reached consensus at the March 2022 TC39 plenary meeting. This adds
tests that verify the change made to the formatting of years between 0 and
999 inclusive in all toString and toJSON methods of Temporal types that
can output an ISO year number in their return value.
2022-04-04 16:36:03 -04:00
Frank Tang cdcf2a3f09 Add tests for Temporal.Calendar.p*.inLeapYear
(Philip, March 2022: This was originally Frank's PR #3056. I did some
reformatting, removed duplicate tests, and combined with some existing
tests.)
2022-04-04 16:34:01 -04:00
Frank Tang 16aefcc6cf Add tests for Temporal.Calendar.p*.mergeFields
(Philip, March 2022: This was originally Frank's PR #3057. I did some
reformatting, removed duplicate tests, addressed the review comments that
I left the first time around, and added some cases that I felt were not
yet complete.)
2022-04-04 16:34:01 -04:00
Frank Tang 6bae30c1b2 Add tests for Temporal.Calendar.p*.monthDayFromFields
(Philip, March 2022: This was originally Frank's PR #3058. I did some
reformatting, removed duplicate tests, and combined with some existing
tests.)
2022-04-04 16:34:01 -04:00
Frank Tang c22b8ab9c4 Add tests for Temporal.Calendar.p*.monthsInYear
(Philip, March 2022: This was originally Frank's PR #3059. I did some
reformatting, removed duplicate tests, and combined with some existing
tests.)
2022-04-04 16:34:01 -04:00
Frank Tang b064eb64f3 Add tests for Temporal.Calendar.p*.weekOfYear
(Philip, March 2022: This was originally Frank's PR #3060. I did some
reformatting, removed a test that didn't exercise the whole feature, and
combined some duplicate tests with some existing tests.)
2022-04-04 16:34:01 -04:00
Philip Chimento ac19506a01 Add tests ensuring that observable calls are made with options === undefined
Where possible, observable calls originating from within Temporal, that
require an options argument, should pass `undefined` as that options
argument, rather than `{}` or `Object.create(null)`.

See tc39/proposal-temporal#1685.
2022-04-04 16:24:17 -04:00
Jesse Alama fe40aea50c Emit fallback day 1 2022-03-29 16:58:36 -07:00
Jesse Alama 9aaa22cb06 Ensure fallback years values are present 2022-03-29 16:58:36 -07:00
Jesse Alama ee1f96235b Ensure reference data is emitted when calendarName = 'always'
References:

+ https://github.com/tc39/proposal-temporal/issues/1971
2022-03-29 16:58:36 -07:00
Jesse Alama 76b0bafba6 Update test/built-ins/Temporal/Duration/compare/twenty-five-hour-day.js
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2022-03-29 16:50:41 -07:00
Jesse Alama 2aa754b7cf Add test for DST balancing
References:

+ https://github.com/tc39/proposal-temporal/issues/1791

Thanks @ptomato for the suggestion to use
`springForwardFallBackTimeZone`.
2022-03-29 16:50:41 -07:00
Richard Gibson 3ab8adc237 Require String.prototype.localeCompare to check for canonical equivalence 2022-03-29 16:43:22 -04:00
Philip Chimento 3eea1a7959 Add tests for various invalid ISO strings for PlainDate
These tests check API entry points that convert strings to
Temporal.PlainDate, with a list of various strings that are all not valid
for that context according to ISO 8601.
2022-03-29 11:26:53 -04:00
Philip Chimento ad74a4ebba Rename some "argument-string" tests to be more specific
I'd like to add basic functionality tests for string arguments, and these
tests are testing something more specific: that a Get of the "overflow"
property on the passed-in options object is observable. Rename
accordingly.
2022-03-29 11:26:53 -04:00
Frank Tang 52af2b6763 Add tests for Temporal.Calendar.p*.yearMonthFromFields
(Philip, March 2022: This was originally Frank's PR #3061. I did some
reformatting, removed duplicate tests, and combined with some existing
tests.)
2022-03-29 11:23:43 -04:00
Frank Tang 0bad719e79 Add test for Temporal.Duration.p*.abs
(Philip, March 2022: This was originally Frank's PR #3062. I did some
reformatting and removed duplicate tests)
2022-03-29 11:23:43 -04:00
Frank Tang f23602f6ce Add test for Temporal.Duration.p*.negated
(Philip, March 2022: This was originally Frank's PR #3063. I did some
reformatting and removed duplicate tests)
2022-03-29 11:23:43 -04:00
Frank Tang b8af7ff369 Add test for Temporal.Duration.p*.toJSON
(Philip, March 2022: This was originally Frank's PR #3064. I did some
reformatting and removed duplicate tests)
2022-03-29 11:23:43 -04:00
Frank Tang 2c8b69f8d0 Add tests for Temporal.Duration.p*.with
(Philip, March 2022: This was originally Frank's PR #3065. I did some
reformatting, removed duplicate tests, and combined with some existing
tests.)
2022-03-29 11:23:43 -04:00
Iban Eguia Moraza f59bafaa20 Fixed YAML in some new test metadata 2022-03-28 12:49:32 -07:00
Ms2ger f964584508 Expand overflow-invalid-string.js tests. 2022-03-25 11:18:13 -07:00
Jesse Alama 7b78d4be74
Port some basic Temporal.PlainDateTime tests from Demitasse to test262 (#3430)
* Create a Temporal.PlainDateTime with all arguments supplied.

Migrates some tests that currently exist in the
proposal-temporal repo.

* Check all data in Temporal.PlainDateTimes, variously constructed

Enrich existing tests to check all basic data in the
instance of `Temporal.PlainDateTime`, not just a single
field.

These additional checks were motivated by the migration of
existing Demitasse tests in the proposal-temporal repo to
test262. The Demitasse tests check more than a single
field.
2022-03-21 12:16:18 -07:00
legendecas f71d5e29cb Add test for throwing WrappedFunctionCreate 2022-03-17 13:59:03 -04:00
Frank Tang 7d5b0ec6f4 Add test for Temporal.Instant.p*.add
This was originally Frank's PR #3075. I rebased it, added assertion
messages, did some reformatting, and combined with some existing tests.
2022-03-14 13:52:04 -04:00
Frank Tang 11c2559651 Add tests for Temporal.Instant.p*.subtract
(Philip, March 2022: I rebased Frank's original PR #3076, did some
reformatting, removed duplicate tests, and combined with some existing
tests.)
2022-03-14 13:52:04 -04:00
Ms2ger 104e5e8fab Test more invalid values for roundingMode. 2022-03-11 09:51:57 +01:00
Ms2ger 51ce1fa00f Expand some Duration#toString() tests. 2022-03-10 17:05:49 -05:00
Ms2ger c6c31c8dac Add and expand tests for Duration constructor / from(). 2022-03-10 17:05:49 -05:00
Ms2ger d45476b9fd Add a test for observable calls in Temporal.Duration constructor. 2022-03-10 17:05:49 -05:00
legendecas 50dc96e59e Split Array.prototype.Symbol.unscopables tests for features 2022-03-10 17:04:16 -05:00
legendecas d8fb00d741 Add missing feature flag array-grouping 2022-03-10 17:04:16 -05:00
Philip Chimento f7fb969cc4 Add tests for T time designator prefix not allowing space
Here's a test I should have included in #3395. It's allowed to replace the
"T" in the middle of an ISO string with a space, but not when the "T" is a
time designator prefix. This assertion ensures that implementations make
this distinction correctly.
2022-02-28 14:41:18 -05:00
Ms2ger 2f592de0aa Port tests for PlainTime. 2022-02-28 14:32:34 -05:00
Ms2ger 18ce639a4c Port tests for PlainTime. 2022-02-21 16:02:05 -05:00
Ms2ger 1fe9bd3951 Add a basic test for PlainDateTime#toPlainTime. 2022-02-21 16:02:05 -05:00
legendecas ec39db5877 Test array grouping Symbol.unscopables values 2022-02-16 09:57:44 -05:00
Ms2ger 0370240141 Port tests for PlainTime. 2022-02-16 09:39:30 -05:00
Ms2ger df873eed1a Port tests for PlainYearMonth#{add,subtract}. 2022-02-08 15:46:11 -05:00
Alexey Shvayka 5cc9a6bda6 Add Array.prototype.unshift() tests 2022-02-08 15:45:38 -05:00
Alexey Shvayka 37ffcfb7ed Add Array.prototype.shift() tests 2022-02-08 15:45:38 -05:00
Alexey Shvayka 1323cc3152 Add Array.prototype.push() tests 2022-02-08 15:45:38 -05:00
Alexey Shvayka 014ca9fcc3 Add Array.prototype.pop() tests 2022-02-08 15:45:38 -05:00
Ms2ger f98a00bc69 Port tests for PlainYearMonth#{since,until}. 2022-02-08 15:44:41 -05:00
Ms2ger 8848ee91e8 Remove smallestunit-disallowed-units.js.
It is covered by smallestunit-invalid-string.js and largestunit-smallestunit-mismatch.js.
2022-02-08 15:44:41 -05:00
Jesse Alama 525313395b Add tests for with() copying defined properties of source object
https://github.com/tc39/proposal-temporal/issues/1910 found a bug in an
indentation level of a line in the Temporal proposal, which affected the
outcome of the PreparePartialTemporalFields abstract operation. This adds
tests for all entry points that use that abstract operation, to make sure
the behaviour is correct: only defined properties are copied in with()
methods.

This was a normative change that achieved consensus at the December 2021
TC39 meeting.
2022-02-08 15:43:25 -05:00
Philip Chimento 6322630064 Add Duration.toString test for fractionalSecondDigits/smallestUnit
https://github.com/tc39/proposal-temporal/pull/1956 clarified that the
fractionalSecondDigits and smallestUnit options to
Temporal.Duration.p.toString() specified the exact number of digits after
the decimal point, no more and no less.

This was a normative change that achieved consensus at the December 2021
TC39 meeting.
2022-02-08 15:43:25 -05:00
Philip Chimento 8e0c895c4d Test 'T' time designator prefix in PlainTime strings
https://github.com/tc39/proposal-temporal/pull/1952 added support for time
designator prefixes in PlainTime strings. This adds three tests to all
entry points that convert an ISO string to a PlainTime:

- no-implicit-midnight: ISO strings with only a date and no time are no
  longer accepted. Previously they were implicitly interpreted as 00:00.
- with-time-designator: Tests that various forms of string with time
  designator are correctly parsed.
- time-designator-required-for-disambiguation: Tests various cases where
  a string without a time designator is ambiguous and therefore the time
  designator is required, as well as various cases that implementations
  might assume are ambiguous but in fact are not.

This was a normative change that achieved consensus at the December 2021
TC39 meeting.
2022-02-08 15:43:25 -05:00
Philip Chimento 7b45a862b1 Test rounding mode in Duration strings with fractional units
https://github.com/tc39/proposal-temporal/pull/1907 was a bug that caused
negative Duration strings with fractional units to be rounded incorrectly.
Add tests that ensure the rounding mode is correct.

This was a normative change that achieved consensus at the December 2021
TC39 meeting.
2022-02-08 15:43:25 -05:00
Philip Chimento 9af34ce28c Rewrite tests that relied on previous branding behaviour
A follow up to the previous commit, this rewrites some tests that relied
on the lack of brand checks for certain Temporal.TimeZone methods.
https://github.com/tc39/proposal-temporal/pull/1693 added brand checks to
these methods.

We can no longer use a plain object time zone or even a Proxy with a real
branded Temporal.TimeZone object as its handler to do these tests, so we
instead create an instance of Temporal.TimeZone and define own accessor
properties on it in order to test the observable property accesses that we
need to see according to the spec text.

This requires an improvement to TemporalHelpers.observeProperty() in order
to be able to log property accesses to Symbol-valued properties.
2022-02-08 15:43:25 -05:00
Jesse Alama f3c485d6da Ensure branding tests for Temporal.Calendar and TimeZone methods
https://github.com/tc39/proposal-temporal/pull/1693 added checks for the
receiver of certain Temporal.Calendar and Temporal.TimeZone methods. Add
branding tests for these methods, similar to the already existing branding
tests.

This was a normative change that achieved consensus at the December 2021
TC39 meeting.
2022-02-08 15:43:25 -05:00
legendecas 281c781ee4
Fix WrappedFunction throwing tests (#3396)
Also adds more non-string cases for copy name
2022-02-04 15:08:14 -08:00
Linus Groh b3774e9593
Add missing propertyHelper.js include to WrappedFunction tests (#3399) 2022-02-04 15:07:55 -08:00
legendecas d5d9f66a8f Test WrappedFunction properties 2022-02-03 13:53:24 -05:00
Ms2ger d71cf3a339 Reorganize tests for PlainYearMonth#{since,until} largestUnit option. 2022-02-03 12:29:16 -05:00
Philip Chimento 4f20476e0a Add tests for largestUnit/smallestUnit mismatch
These tests already existed for PlainDate. Copy them to the other types
(and use the constructor instead of from() in order to be as simple as
possible)
2022-02-01 18:02:08 -05:00
Philip Chimento 06ced3f812 Add forgotten PlainDate tests
I forgot to add these to PlainDate, testing what happens when we pass
undefined as the value for the largestUnit option. Similar tests already
exist for the other types.
2022-02-01 18:02:08 -05:00
Philip Chimento 4382f17f29 Expand largestUnit and smallestUnit invalid strings tests
Some of these (in PlainDate) had already been rewritten to test more
invalid strings that are otherwise valid units. This commit takes these
improvements and brings them to all of the similar tests for other types'
since() and until() methods.
2022-02-01 18:02:08 -05:00
Jesse Alama 7d82f8ac63 Add tests for invalid extended year "-000000"
https://github.com/tc39/proposal-temporal/issues/1753 records the
consensus reached at the October 2021 TC39 meeting to disallow "-000000"
as an extended year, both in Date.parse and Temporal. This adds tests for
the Temporal part of that.
2022-02-01 17:59:02 -05:00
Philip Chimento 141aca7dba Test offset property in ZonedDateTime property bags
https://github.com/tc39/proposal-temporal/pull/1893 was a bug that caused
the 'offset' property to be ignored in ZonedDateTime property bags. Add
tests that ensure it is not ignored.

This was a normative change that achieved consensus at the October 2021
TC39 meeting.
2022-02-01 17:59:02 -05:00
Jesse Alama 7835f64ae0 Check relativeTo for certain non-zero years, weeks, months, and days
https://github.com/tc39/proposal-temporal/pull/1780 fixed a typo in the
UnbalanceDurationRelative abstract operation, which should affect the
entry points tested here.

This was a normative change that achieved consensus at the October 2021
TC39 meeting.
2022-02-01 17:59:02 -05:00
Ms2ger 331c144f2e Test limits in PlainDate#toPlainYearMonth. 2022-02-01 17:58:30 -05:00
Ms2ger 20329ef359 Test limits in PlainYearMonth.from. 2022-02-01 17:58:30 -05:00
Ms2ger f857cf9968 Test limits in PlainYearMonth constructor. 2022-02-01 17:58:30 -05:00
Ms2ger 516f9a9083 Test PlainYearMonth.prototype.toString. 2022-02-01 17:58:30 -05:00
Ms2ger fddbb4fdf7 Test PlainYearMonth.prototype.toPlainDate. 2022-02-01 17:58:30 -05:00
Ms2ger 51d5cf9a44 Test PlainYearMonth.prototype.valueOf. 2022-02-01 17:58:30 -05:00
Ms2ger ab6fab987e Test PlainYearMonth.prototype.equals. 2022-02-01 17:58:30 -05:00
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
Marko Lahma 91356f52f9 Add AggregateError as feature to seal-aggregateerror.js 2022-01-11 10:08:18 -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
Csaba Osztrogonác bd1acb51a4 tools: enforce restriction on YAML includes key
Includes key should use flow notation to be able parsed easier
as suggested in https://github.com/tc39/test262/issues/1997

Added this check to the linting script and updated tests accordingly.
2022-01-05 17:27:58 -05:00