Commit Graph

5874 Commits

Author SHA1 Message Date
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 7d31aa21ad Temporal: Add basic IANA-time-zone-aware tests for TimeZone.getPlainDateTimeFor
This adds several tests for values that should be produced by the time
zone database and should not be subject to change in the future. This
tests basic functionality of TimeZone.getPlainDateTimeFor with an IANA
time zone database.
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
Philip Chimento 8ea8e3f15d Temporal: Add tests for IANA legacy name time zones
Aside from the ones that were already tested in etc-timezones.js, this
adds a test for other IANA legacy names.

Previously these were supported in the TimeZone constructor, but not in
from().

See https://github.com/tc39/proposal-temporal/pull/2292 which is a
normative change that achieved consensus at the July 2022 TC39 meeting.
2022-07-28 12:00:29 -07:00
Philip Chimento 5cb596f191 Temporal: Perform TimeZone 'Etc/GMT±NN' tests for from() as well
The Etc/GMT±... time zones should be accepted in from() as well as the
TimeZone constructor. Previously this was not the case for +0 and -0 due
to those being IANA legacy names.

This basically copies the existing test file for the TimeZone constructor,
and performs the same tests for TimeZone.from().

See https://github.com/tc39/proposal-temporal/pull/2292 which is a
normative change that achieved consensus at the July 2022 TC39 meeting.
2022-07-28 12:00:29 -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
André Bargull 12b7b5c916 Temporal: tests for out-of-range time zone transitions
This normative change reached consensus in the July 2022 TC39 meeting:
https://github.com/tc39/proposal-temporal/pull/2351
2022-07-25 13:33:32 -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
Frank Yung-Fong Tang e41d581c6d Sync with pull/100 of intl-numberformat-v3
https://github.com/tc39/proposal-intl-numberformat-v3/pull/100/files
2022-07-25 12:40:18 -07:00
snek 6833180066 add SharedArrayBuffer feature to test 2022-07-22 07:04:58 -07:00
Frank Yung-Fong Tang ab29fd3225
Sync to PR701 (#3609)
In 2022-07-20 TC39 we decide to take 
https://github.com/tc39/ecma402/pull/701 and not check the order of the x and y 
see https://docs.google.com/presentation/d/1UUvbf3FFu9PGtrPAKPdMad9DZuVFLIvkAsAxyJZyvxM/ for details
2022-07-21 13:30:08 -07:00
Romulo Cintra 7b2a9bb441
DurationFormat basic format tests (#3604) 2022-07-21 11:07:40 -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
Romulo Cintra 91a61b29ac meta: add missing feature flag 2022-07-13 09:16:05 -07:00
Frank Yung-Fong Tang f541d991f9 Remove comments after PR92
https://github.com/tc39/proposal-intl-numberformat-v3/pull/92/files
2022-07-13 08:20:44 -07:00
Frank Yung-Fong Tang e6b4558ae8 Sync test to PR29 of numberformat-v3
https://github.com/tc39/proposal-intl-numberformat-v3/pull/92/files
2022-07-13 08:20:44 -07:00
Romulo Cintra 6432c9df20
Increase the Intl.DurationFormat Coverage (#3592)
Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2022-07-13 12:23:57 +02: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 ab13ee1513 Add missing `define` 2022-07-12 19:21:53 -07:00
Mathias Bynens 33ea5b6439 Move folder around 2022-07-12 19:21:53 -07:00
Mathias Bynens 242128ec78 Update regExpUtils.js 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
Yusuke Suzuki b2b6756044 Fix useGrouping tests based on the latest Intl.NumberFormat v3 change
Based on discussion[1], useGrouping computation in Intl.NumberFormat v3 is updated[2] to keep web compatibility.
This change fixes the existing test which is testing the previous behavior.

[1]: https://github.com/tc39/proposal-intl-numberformat-v3/issues/74
[2]: d13bd63f8f
2022-07-04 11:13:37 -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
Romulo Cintra 392f0049d7 test invalid negative durations objects 2022-07-01 09:26:43 +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
Romulo Cintra b458b9f0c2 Update harness/testIntl.js
thks

Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2022-06-23 16:15:30 -04:00
Romulo Cintra 2877facc4c Update testIntl.js
Add NS digit mappings
2022-06-23 16:15:30 -04:00
Romulo Cintra 0efbba27ff Normative: Add new numbering system "tnsa"
Add [tnsa](https://github.com/unicode-org/cldr/blob/main/common/bcp47/number.xml#L95) to number systems
2022-06-23 16:15:30 -04:00
legendecas ee521159d5 Fix decorator tests 2022-06-23 15:17:43 -04: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
Youssef Soliman 79c4496559 Fixed spelling error identifer -> identifier. 2022-06-21 10:14:17 +02:00