Commit Graph

5337 Commits

Author SHA1 Message Date
Ioanna M Dimitriou H d2596e2651
RAB: Integrate staging tests for the .every method (#4074)
* RAB: Integrate staging tests for the .every method
of Array.prototype and TypedArray.prototype

This is part of PR #3888 to make reviewing easier.
Includes changes to use the helper ./harness/resizableArrayBufferUtils.js

* Added missing includes

* Removed unnecessary function call.

* Apply suggestions from code review

* Applied review suggestion to the rest of the files

* Addressed forgotten review comment noting some files are missing.

https://github.com/tc39/test262/pull/4074#pullrequestreview-2046589557

Adds forgotten tests from #3888

* Addresses review comment.

* Fixed forgotten rename

* Simplify the tests and add documentation.

New approach replaces ...Helper with CollectResize to make the tests easier to understand.
In particular:
- Replaced the need for '...Helper' abstractions with a more descriptive
  function 'ResizeBufferMidIteration', which the .every method can call
  directly.
- Moved 'let values' back outside of the loops, together with a function
  definition 'ResizeBufferMidIteration' to persist the side effects that
  'CollectValuesAndResize' has on 'values' but without having to define
  this inside every loop.
  + So this reverts commit d9a2bac41f87f0964a43d34c6f349b6d78401633 and
  + this reverts commit 0bc2d66335671cac56912981b73c7900bf309cee.
- Added documentation.

* Documentation style change and remove accidental additions.
2024-06-28 16:42:09 -07:00
Nicolò Ribaudo 03852c962b
Avoid duplicate binding import-source-binding-name.js (#4121) 2024-06-28 15:14:23 +02:00
SUZUKI Sosuke 27b2551c00
Add test to check `nfOptions.roundingMode` for seconds / microseconds / nanoseconds is `"trunc"` (#4115)
* Test that `nfOptions.roundingMode` for seconds / microseconds / nanoseconds is `"trunc"`

* Add license header

* Use `Intl.NumberFormat` instead of `testintl.js` harness

* Use correct harness
2024-06-27 10:08:11 -07:00
Chengzhong Wu 8a2229cde8
Add tests for Source Phase Imports (#3980) 2024-06-27 14:58:04 +02:00
Frank Yung-Fong Tang c3a326ace8
Add test for ECMA402 PR833 Allow locale based ignorePunctuation default (#3922)
* Add test for ECMA402 833

https://github.com/tc39/ecma402/pull/833

* Update test/intl402/Collator/prototype/resolvedOptions/ignorePunctuation-default.js

Co-authored-by: André Bargull <andre.bargull@gmail.com>

* Update test/intl402/Collator/prototype/resolvedOptions/ignorePunctuation-default.js

Co-authored-by: André Bargull <andre.bargull@gmail.com>

---------

Co-authored-by: André Bargull <andre.bargull@gmail.com>
2024-06-26 17:40:01 -07:00
Ioanna M Dimitriou H c2815ec090
RAB: Integrate staging tests for .fill method (#4075)
RAB: Integrate staging tests for the .fill method
of Array.prototype and TypedArray.prototype

This is part of PR #3888 to make reviewing easier.
Includes changes to use the helper ./harness/resizableArrayBufferUtils.js
2024-06-26 16:26:22 -07:00
Ioanna M Dimitriou H cbdff1ca5f
RAB: Integrate staging tests for the .entries method (#4073)
RAB: Integrate staging tests for the .entries method
of Array.prototype and TypedArray.prototype

This is part of PR #3888 to make reviewing easier.
Includes changes to use the helper ./harness/resizableArrayBufferUtils.js
2024-06-26 16:12:35 -07:00
Ioanna M Dimitriou H d7b2f4acfc
RAB: Integrate staging tests for .copyWithin method (#4072)
RAB: Integrate staging tests for .copyWithin method
of Array.prototype and TypedArray.prototype

This is part of PR #3888 to make reviewing easier.
Includes changes to use the helper ./harness/resizableArrayBufferUtils.js
2024-06-26 16:05:45 -07:00
André Bargull c47b716e8d Update harness tests for Float16Array
Fixes #4029
2024-06-24 17:02:39 +02:00
Shu-yu Guo 29c6f7028a [top-level-await] Sync implementation with spec text
The module evaluation machinery has undergone non-trivial refactoring
since implementation. Sync up the comments and code for maintenance.

Notably,

- Actually use the kEvaluatingAsync status (previously conflated under
  kEvaluated)
- [[IsAsyncEvaluating]] -> [[IsAsyncEvaluation]]
- GatherAsyncParentCompletions -> GatherAvailableAncestors
- async -> has_toplevel_await
- kAsyncModule -> kModuleWithTopLevelAwait

Bug: 347060515
Change-Id: Ia2c35d5b42ee9f58db841cdfcaef9d17b018c9c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5636701
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94591}
2024-06-21 23:23:02 +02:00
André Bargull 43a64eabe3 Remove empty info block scalar 2024-06-21 10:17:07 +02:00
Linus Groh 15ae4bb43f Fix wrong array literal in Map/Set value tests 2024-06-14 01:26:22 +02:00
Philip Chimento 58df8fb22a Temporal: Remove methods with ISO-named pairs
See tc39/proposal-temporal#2846
2024-06-13 22:04:16 +02:00
Philip Chimento 3c28e3a359 Temporal: Remove Plain/ZonedDateTime to PlainYearMonth/MonthDay APIs
See tc39/proposal-temporal#2848
2024-06-13 22:04:16 +02:00
Philip Chimento 1c900ca59c Temporal: Remove epoch seconds and epoch microseconds APIs
See: tc39/proposal-temporal#2849
2024-06-13 22:04:16 +02:00
Philip Chimento 7184313667 Temporal: Remove PlainTime.toPlainDateTime/toZonedDateTime methods
See tc39/proposal-temporal#2848
2024-06-13 22:04:16 +02:00
Philip Chimento a9c223c60e Temporal: Remove withPlainDate() methods
See tc39/proposal-temporal#2847.
2024-06-13 22:04:16 +02:00
Philip Chimento 61e3f5ec4d Temporal: Tests for removal of relativeTo from Duration.p.add/subtract
See tc39/proposal-temporal#2825.

Various edits to existing tests so that they make more sense with the
removal of relativeTo.

New tests specifically testing that calendar units cannot be added or
subtracted directly.
2024-06-13 13:54:46 +02:00
Philip Chimento ea4945c66f Temporal: Remove tests using relativeTo in Duration.p.add/subtract
See tc39/proposal-temporal#2825. This is a mass removal of tests that use
this functionality, in a separate commit for ease of review. Further
adjustments will be made in the following commit.
2024-06-13 13:54:46 +02:00
Adam Shaw ba9c397923 tests for https://github.com/tc39/proposal-temporal/issues/2820 2024-06-13 08:54:19 +02:00
André Bargull 2496577225
Fix strict mode errors in Temporal staging test (#4100) 2024-05-30 16:07:35 +02:00
André Bargull 42a9f69ab2 Declare variables to allow running in strict-mode 2024-05-29 11:10:42 +02:00
André Bargull 57b9f154a6 Allow alternative implementations for Chinese lunar calendar 2024-05-29 10:47:09 +02:00
André Bargull efe0b1871f Split yearMonthFromFields/reference-day.js into calendar specific files 2024-05-29 10:47:09 +02:00
Sosuke Suzuki c00830acef Fix description of `fractionalDigits` tests 2024-05-28 15:41:01 +02:00
Luis Fernando Pardo Sixtos e394ebb6fc [decorators] Add flag, accessor keyword and token
This change doesn't do any functionality changes.

Bug: 42202709
Change-Id: I613b96b6e7630e10748e31162080a61e7da4c2a1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5542951
Commit-Queue: Luis Pardo <lpardosixtos@microsoft.com>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94086}
2024-05-27 09:22:09 +02:00
Timothy Leverett 2a7468c934 Temporal: fix messages on `Duration/out-of-range` tests
Fixed test messages that incorrectly referenced the `days` parameter to say `weeks` instead.
2024-05-23 19:16:00 -07:00
test262-merge-bot 0eb7f6eccb
Merge branch 'main' into chromium-export-7eb56ce860 2024-05-19 12:19:57 +02:00
Timothy Flynn 232dfc7b60
Add missing `return` statement to `throwsAsync` callback
This callback is expected to return a thenable.
2024-05-18 11:30:57 -04:00
Jordan Harband 5217ef396e
throwsAsync, `Promise.try`: avoid unneeded syntax
Followup to #4086
2024-05-17 09:13:21 -07:00
Sosuke Suzuki 57c7d06bf1 Wrap `throwsAsync` with `asyncTest` 2024-05-17 16:31:13 +02:00
Sosuke Suzuki 3d3df6ec02 Remove incorrect property access 2024-05-17 21:57:46 +09:00
Sosuke Suzuki d4fac47d3b Fix `asyncTest` usage for `Promise.try` tests 2024-05-17 14:20:50 +02:00
Rezvan Mahdavi Hezaveh 081808bebd [explicit-resource-management] Add adopt and defer
This CL adds adopt() and defer() to DisposableStack
prototype.

Bug: 42203506
Change-Id: I556b96a0cf42595acdd483b0a02aef9ca41bd0bc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5512877
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#93930}
2024-05-15 23:18:28 +02:00
Rezvan Mahdavi Hezaveh fb7ab87dd5 [explicit-resource-management] Add move and disposed getter
This CL adds move() function and a getter for disposed to
DisposableStack prototype.

Bug: 42203506
Change-Id: I8d7750b1d4aa199ebeb997bde7fe6d06c9ccbff0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5528992
Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#93931}
2024-05-15 13:19:32 -07:00
Jordan Harband 8b6b0f516d
add Promise.try tests 2024-05-01 15:27:31 -07:00
Philip Chimento a7e796a4ce Temporal: Add test coverage for edge case in DST balancing after rounding
This covers an edge case that we hit, where 24 hours would not balance up
to one day in a 25-hour day if only largestUnit was specified, but would
erroneously balance up if rounding was also performed by specifying
smallestUnit.
2024-05-14 09:24:12 +02:00
Philip Chimento 500cea9384 Temporal: Add test coverage for large roundingIncrement in ZDT math
In ZonedDateTime.p.since/until, it's possible for AddDateTime to hit the
limit if the rounding increment is very high, even if the resulting
rounded duration isn't outside of the limit. Add a test covering this
case.
2024-05-14 09:24:12 +02:00
Philip Chimento e02220badd Temporal: Move some round() and total() tests out of staging
Including tests for every possible combination of largest and smallest
unit, for each type of relativeTo (undefined, PlainDate, ZonedDateTime).
2024-05-14 09:24:12 +02:00
Philip Chimento 96e31e7e28 Temporal: Tests for round() and since()/until() using the same code path
This should produce all the same results (except for a change to weeks
balancing in round(), which is now more consistent with since()/until())
but leads to different observable user code calls.

See https://github.com/tc39/proposal-temporal/issues/2742
2024-05-14 09:24:12 +02:00
Philip Chimento 6c6c72b063 Temporal: Adjust tests for Duration rounding fix
A MoveRelativeZonedDateTime step was missing, causing incorrect results.
See https://github.com/tc39/proposal-temporal/issues/2742
2024-05-14 09:24:12 +02:00
Rezvan Mahdavi Hezaveh 9b4c6577f6 [explicit-resource-management] Add DisposableStack constructor, use
and dispose method

This CL adds DisposableStack constructor, use() and dispose() methods
as developer exposed methods. Also, this CL fixed the use
of `using` keyword with `null` and `undefined` and adds tests for them.

Bug: 42203506
Change-Id: If50b9e33d9cbb3de2be41dc81e656d9d202b8fa8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5498999
Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#93807}
2024-05-09 00:18:17 +02:00
Ioanna M Dimitriou H 55a5346f99
RAB: Integrate staging tests for .byteLength method (#4071)
* RAB: Integrate staging tests for .byteLength method
of TypedArray.prototype

This is part of PR #3888 to make reviewing easier.
Includes changes to use the helper ./harness/resizableArrayBufferUtils.js
2024-05-08 08:35:46 -07:00
Ioanna M Dimitriou H 0fca7339eb
RAB: Integrate staging tests for .at method (#4070)
* RAB: Integrate staging tests for .at method
of Array.prototype and TypedArray.prototype

This is part of PR #3888 to make reviewing easier.
Includes changes to use the helper ./harness/resizableArrayBufferUtils.js
2024-05-08 08:27:49 -07:00
Ben Allen 8724a0de23 ListFormats used in DurationFormat/prototype/format/fractions-of-subsecond-units-en.js were missing required `type: "unit"` option 2024-04-29 15:54:34 +02:00
Linus Groh cdf7ba7396 Fix typo in with statement test file name 2024-04-29 15:30:25 +02:00
Rezvan Mahdavi Hezaveh 27b6e4500f [explicit-resource-management]Add exception handling to sync ERM
This CL adds exception handling to the implementation of sync
explicit management proposal.

Bug: v8:13559
Change-Id: I2f4ffea432057b753634c2af4801f9dc48edac43
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5405985
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#93620}
2024-04-26 20:18:23 +02:00
Frank Yung-Fong Tang c2ae5ed5e9 Fix mixed-short-and-numeric.js
The option for the listFormat need to include {type: "unit"}
2024-04-25 10:55:21 +02:00
André Bargull a640565994 Add test for negative zero inputs 2024-04-23 18:27:01 +02:00
André Bargull 859b5c67ef Update numeric-hour-with-zero-minutes-and-non-zero-seconds for new default display of sub-hours units
Numeric "minute" and "seconds" units now default to "always" display, so we have
to add an additional test to cover when "auto" display is used. Additionally add
more inputs to cover all possible test combinations.
2024-04-23 18:27:01 +02:00
André Bargull 19d2a38558 Add tests for negative durations with leading zero unit 2024-04-23 18:27:01 +02:00
André Bargull cadd064174 Use formatDurationFormatPattern for "/numeric-hour-with-zero-minutes-and-non-zero-seconds"
The changes from the first commit allow to use
`formatDurationFormatPattern` for this test.
2024-04-23 18:27:01 +02:00
André Bargull 330ecdd016 Sync partitionDurationFormatPattern with latest spec draft
Sync `partitionDurationFormatPattern` with the latest spec draft and
change it to use an `Intl.DurationFormat` object as the input, so it's
easier to compare it against the spec text and because it allows to test
more inputs.

Includes the fixes for:
- https://github.com/tc39/proposal-intl-duration-format/pull/183
- https://github.com/tc39/proposal-intl-duration-format/pull/184
2024-04-23 18:27:01 +02:00
Ben Allen b37947f3a4 Removed extraneous comment, added roundingMode: 'trunc' to NumberFormat options when fractional digits are formatted to match behaviour of DurationFormat -- doesn't make a difference with these test values, but could with others 2024-04-23 11:30:16 +02:00
Ross Kirsling 007b333af2 Add additional tests for tc39/ecma262#3307.
Ensure that the following cases are covered:
- https://github.com/tc39/ecma262/issues/3295#issuecomment-2058110314
- https://github.com/tc39/ecma262/issues/2659#issue-1131245695
2024-04-22 12:36:07 -07:00
Mathias Bynens 830b17a3a0 Update RegExp `\p{…}` tests per Unicode 15.1.0
Issue: #3945
2024-04-17 16:04:56 -07:00
Marko Lahma 263c514afa Add missing DummyError function definition to target-super-computed-reference.js 2024-04-15 11:30:42 -07:00
Sosuke Suzuki 23c3e0111b Use space instead of tab in comments 2024-04-15 11:11:23 -07:00
Ross Kirsling 142a6a6fbe
Update test for o[p] = f() (#4052)
* Update test for o[p] = f()

Update S11.13.1_A7_T3.js now that consensus has been reached on https://github.com/tc39/ecma262/pull/3307.

* Rename test and add an analogous one for super.
2024-04-12 11:59:40 -07:00
Shu-yu Guo c5a80993cd Allow global var-via-eval be declared
See https://github.com/tc39/ecma262/pull/3226
2024-04-11 17:22:43 -07:00
Ben Allen 046dff4b33
test formatting when microseconds or nanoseconds are the first numeric-styled unit (#4034)
* test formatting when microseconds or nanoseconds are the first numeric-styled unit

* incorporated Philip Chimento guidance re: padding fractional components
2024-04-11 17:02:37 -07:00
Shu-yu Guo 0c43c587cc Fix groupBy string test keys to be insertion order 2024-04-11 16:56:41 -07:00
Ben Allen e11ef85b1b
added test for formatting mixture of short and numeric styles (#4033)
* added test for formatting mixture of short and numeric styles

* incorporated Philip Chimento feedback re: making test more general across locales
2024-04-11 16:29:13 -07:00
Frank Tang b37b6f3552 Fix incorrect tests landed in PR3890
https://github.com/tc39/test262/pull/3890
2024-04-11 16:33:56 +02:00
Philip Chimento d865ffeb2d Use correct keys in non-iso-calendars.js
Using Object.keys() of the expected values in each case decouples these
tests.
2024-04-10 08:37:31 -07:00
Philip Chimento bce41ea609 Reduce locale-dependence in non-iso-calendars.js
Previously, this test checked for a particular format. This would break
depending on which engine executed it. Instead, test for the presence of
particular types and their values in the output of formatToParts().

(There's an existing comment which suggests that this should already have
been testing formatToParts().)
2024-04-10 08:37:31 -07:00
Philip Chimento 9537de33af Remove performance logging from non-iso-calendars.js staging test
The performance logging was left over from when this test lived in the
proposal-temporal repo. It was already switched off anyway.
2024-04-10 08:37:31 -07:00
Adam Shaw 6c60904d42 test for all overflow/underflow scenarios 2024-04-08 18:24:26 -07:00
Adam Shaw 6c35fba9b2 adjust tests for round-zdt-day bugfix 2024-04-08 18:24:26 -07:00
Sosuke Suzuki b73f7d662d Use emoji strings 2024-04-04 12:47:57 -07:00
SUZUKI Sosuke 065ccc121e Update test/built-ins/Object/groupBy/string.js
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2024-04-04 12:47:57 -07:00
SUZUKI Sosuke 8245443f8f Update test/built-ins/Map/groupBy/string.js
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2024-04-04 12:47:57 -07:00
Sosuke Suzuki 112cf25567 Add tests for `Object.groupBy` and `Map.groupBy` with string items 2024-04-04 12:47:57 -07:00
Ben Allen e0a0c27796
DurationFormat: added tests for default styles for units following numeric-styled units (#4032) 2024-04-03 18:09:00 +02:00
Philip Chimento 63933d1da5 Temporal: Tests that dateStyle affects toLocaleString output
For each Temporal type, add a test (which should not be sensitive to the
exact locale format) that ensures dateStyle affects the output, for a
Gregorian and non-Gregorian calendar.

See https://github.com/tc39/proposal-temporal/issues/2058
2024-04-03 12:32:46 +02:00
Philip Chimento a074d97c5b Temporal: Tests for conversion of ISO 8601 string to ISO 8601 calendar
See https://github.com/tc39/proposal-temporal/issues/2105. This was not
covered yet in test262.
2024-04-03 12:32:46 +02:00
Philip Chimento a8da70622d Temporal: Tests for calendar.dateFromFields options in PYM/PMD.toPlainDate
It was previously not tested what options value a custom calendar's
dateFromFields() method would be called with, when called from the
toPlainDate() method of PlainYearMonth/PlainMonthDay.

See tc39/proposal-temporal#2803
2024-04-03 12:32:46 +02:00
Philip Chimento b4b574fca1 Temporal: argument-propertybag-calendar-year-zero testing the wrong thing
These tests were supposed to test an invalid ISO string being used as the
`calendar` property in a property bag. Instead they were testing being
used as an invalid ISO string directly where a PlainDate input was needed.
(That is also already covered elsewhere.)
2024-04-03 12:32:46 +02:00
Philip Chimento 0cb219ffe0 Temporal: Fix argument-propertybag-calendar-number testing the wrong methods
Due to overlooked copy-paste errors we were creating the wrong type of
instance in these tests, and therefore testing the wrong method.

(Add blank line for consistency with the other instances of these tests.)
2024-04-03 12:32:46 +02:00
Philip Chimento d7aec8e178 Temporal: Add test for Duration going out of range after rounding
After rounding relative to a ZonedDateTime, we have to potentially adjust
for DST. With a time zone providing nonsensical values, the duration may
go out of range.

See: tc39/proposal-temporal#2801
2024-04-03 12:32:46 +02:00
Philip Chimento f03883c7bb Temporal: Fix assertion message about float64-representable integer
This test isn't testing what the assertion message previously said it was
testing. The integer is allowed to be unsafe, but in this case its
float64-representation is out of range.

See: https://github.com/tc39/proposal-temporal/issues/2785
2024-04-03 12:32:46 +02:00
Philip Chimento c4f5778671 Temporal: Add tests for mixed signs in DifferenceTemporalPlainDateTime
With test cases kindly provided by Anba, this adds test coverage for the
abrupt completion in the last step of DifferenceTemporalPlainDateTime,
where the resulting Duration components have mixed signs.

See: https://github.com/tc39/proposal-temporal/issues/2783
2024-04-03 12:32:46 +02:00
Philip Chimento c8a876b1d9 Temporal: Add clarifying assertion messages
normalized-time-duration-to-days-range-errors.js tests for several error
cases in the AO NormalizedTimeDurationToDays. Adding assertion messages
helps to know which one you are debugging.
2024-04-03 12:32:46 +02:00
Philip Chimento 0c12b84244 Temporal: Add tests for incorrectly capitalized annotation keys
As per IETF, annotation keys may only consist of lowercase letters,
dashes, and digits, and an optional leading underscore. Uppercase letters
are non-syntactical. Add tests covering this.
2024-04-03 12:32:46 +02:00
Philip Chimento 8b781361a9 Temporal: Add test for last step of UnbalanceDateDurationRelative throwing
Based on a test case by Anba.
See https://github.com/tc39/proposal-temporal/pull/2690#issuecomment-1938768702
2024-04-03 12:32:46 +02:00
Philip Chimento f4f33d272c Temporal: Fix assertion message 2024-04-03 12:32:46 +02:00
Philip Chimento 1e3d8cbb37 Add extra tests for newly fixed bug 2024-04-01 17:44:45 -07:00
Adam Shaw 96718952b0 updated tests for ZDT diffing w/ backoffs 2024-04-01 17:44:45 -07:00
Philip Chimento 984f3cc284 Temporal: Tests for correct intermediate value in ZonedDateTime difference/rounding
These test cases ensure that DST disambiguation does not take place on
intermediate values that are not the start or the end of the calculation.

Note that NormalizedTimeDurationToDays is no longer called inside
Temporal.Duration.prototype.add/subtract, so a few tests can be deleted.

Other tests need to be adjusted because NormalizedTimeDurationToDays is
no longer called inside Temporal.ZonedDateTime.prototype.since/until via
DifferenceZonedDateTime, although it is still called as part of rounding.

In addition, new tests for the now-fixed edge case are added, and for the
day corrections that can happen to intermediates.

See https://github.com/tc39/proposal-temporal/pull/2760
2024-04-01 17:44:45 -07:00
Philip Chimento 837def66ac Apply suggestions from code review
Co-authored-by: Ioanna M Dimitriou H <9728696+ioannad@users.noreply.github.com>
2024-03-27 17:49:35 -07:00
André Bargull 71f95c29bd Add tests for resizable array buffer views
Covers spec compliance issues in at least one of JSC, V8, or SM.
2024-03-27 17:49:35 -07:00
Ben Allen 634933a489 DurationFormat: test formatting for units using combinations of "long", "short", and "narrow" styles 2024-03-27 09:49:09 -07:00
Ben Allen 86b6eee25b Correct Intl.DateTimeFormat and Intl.DisplayNames metadata incorrectly identifying tests for 'en' locale as tests for 'en-US' 2024-03-26 09:13:11 -07:00
Ben Allen 39168e26c8 DurationFormat: changed metadata to list 'en' instead of 'en-US' as locale for tests that actually test 'en' rather than 'en-US' 2024-03-25 15:36:57 -07:00
Kevin Gibbons decf9f2526 re-run rewrite scripts 2024-03-25 15:22:57 -07:00
Kevin Gibbons 927a70d4df fix typo in test name 2024-03-25 15:22:57 -07:00
Kevin Gibbons 4f7a43afbd add tests for get/setFloat16 2024-03-25 15:22:57 -07:00
Kevin Gibbons 435dcc9f6e tests for Math.f16round 2024-03-25 15:22:57 -07:00
Rezvan Mahdavi Hezaveh db7c0d1499 [explicit-resource-management] Add using in bytecode generator
This CL adds `using` to bytecode generator. This CL does not include exception handling and JSDisposableStack methods.
Also, since `using` and `const` have the same behavior (except for disposing resources), we add required checks to the existing code.

Bug: v8:13559
Change-Id: I1d169859cc2a3e16c7cc9078219d5e4a466f4560
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5270855
Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#93014}
2024-03-25 19:18:58 +01:00
Kevin Gibbons 961480ac61 remove some auto-generated error messages in "assert.throws" tests 2024-03-25 12:09:10 +01:00
Kevin Gibbons 5424d7e834 rewrite tests to use verifyProperty 2024-03-25 12:05:06 +01:00
Ben Allen 0b1abd5ee7
Two tests previously assumed 'en' as locale for DurationFormat, assumption now made explicit (#4019) 2024-03-15 09:35:47 +01:00
Ben Allen af3890a10a update to reflect numeric minutes handling after https://github.com/tc39/proposal-intl-duration-format/pull/180 2024-03-13 12:00:37 +01:00
André Bargull 263ed65292 Remove locales with explicit u-hc Unicode extension
The tests are passing an explicit `hour12` option, which disables any
`hourCycle` option and any `u-hc` Unicode extension. Therefore passing
input locales with `u-hc` is invalid.

```js
let locale = "en-u-hc-h24";
let hcDefault = new Intl.DateTimeFormat(locale, { hour: "numeric" }).resolvedOptions().hourCycle;

assert.sameValue(hcDefault, "h24", "hour-cycle through Unicode extension");

let hc24 = new Intl.DateTimeFormat(locale, { hour: "numeric", hour12: false }).resolvedOptions().hourCycle;

// Incorrect assertion, because |hc24| uses |hour12|, which disables any
// hour-cycle option and the hour-cycle is determined from the locale "en".
// That means |hc24| will be "h23".
assert.sameValue(hc24, hcDefault);
```
2024-03-08 16:15:08 -08:00
Ron Buckton 46fc281430 Add tests for RegExp modifiers 2024-03-07 10:45:31 -08:00
Ioanna M. Dimitriou H 9e03c403e7 Test parsing error when using unicode escape sequences to express i, m, s
As suggested in https://github.com/tc39/test262/pull/3960#issuecomment-1966827213
2024-03-05 12:56:48 -08:00
Guillaume Emont 229a27bcbc Added new generated tests with uppercase I
Co-Authored-By: Ioanna M. Dimitriou H <idimitriou@igalia.com>
2024-03-05 12:56:48 -08:00
Cam Tenny 49a58a4716 Adds syntax tests for the RegExp modifiers proposal
Based on PR #3807 which had generated these tests from templates,
but was stuck due to issue #3808.

Co-Authored-By: Guillaume Emont <guijemont@igalia.com>
Co-Authored-By: Ioanna M. Dimitriou H <idimitriou@igalia.com>
2024-03-05 12:56:48 -08:00
André Bargull 62626e083b Update tests in built-ins/Object/defineProperty to use verifyProperty 2024-02-28 17:01:01 -08:00
André Bargull 03a0375267 Update built-ins/Object to use verifyProperty 2024-02-28 17:01:01 -08:00
André Bargull e108e876cd Update built-ins/Object/{create,freeze,seal} to use verifyProperty 2024-02-28 17:01:01 -08:00
André Bargull e3ba8cea11 Update built-ins/Object/defineProperties to use verifyProperty 2024-02-28 17:01:01 -08:00
André Bargull 3499832c3c Update built-ins/Object/defineProperty to use verifyProperty 2024-02-28 17:01:01 -08:00
Frank Yung-Fong Tang a2597599bc Add test for ECMA402 PR846
the calenar name should be canonicalized
Spec change https://github.com/tc39/ecma402/pull/846
2024-02-23 15:53:00 -08:00
Aditi 0fd1675f7e Temporal: Add weekOfYear() and yearOfWeek() tests for custom calendars 2024-02-21 10:40:18 -08:00
Aditi ae8fe25b5a Temporal: Tests for week-numbering algorithm 2024-02-21 10:40:18 -08:00
Nicolò Ribaudo c0e8eef81b
Add test for async module not blocking sync siblings (#3955) 2024-02-21 14:53:10 +01:00
Rezvan Mahdavi Hezaveh 45e740928f [test262] Add staging test for RegExp named groups (search)
This CL adds a staging test for testing test262 bot.

Bug: v8:13173
Change-Id: Id8982a3d18bca219133f672736064e4d57d6da59
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5294455
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Cr-Commit-Position: refs/heads/main@{#92372}
2024-02-16 18:21:13 +01:00
Rezvan Mahdavi Hezaveh 903f7fc74d [test262] Add staging test for RegExp named groups (replace)
This CL adds a staging test for testing test262 bot.

Bug: v8:13173
Change-Id: Id24a5b5665bbc491acd59c16ede80d6780bbd4b2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5293730
Commit-Queue: Liviu Rau <liviurau@google.com>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Cr-Commit-Position: refs/heads/main@{#92363}
2024-02-16 16:18:20 +01:00
Rezvan Mahdavi Hezaveh 6f7ae1f311 [test262] Add new staging test for RegExp named groups
This CL adds a staging test for testing test262 bot.

Bug: v8:13173
Change-Id: I7f3d3aa3fbcf30b08cf3ebf2c61a683b7d2cf7c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5281634
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Liviu Rau <liviurau@google.com>
Cr-Commit-Position: refs/heads/main@{#92345}
2024-02-15 16:48:14 +01:00
André Bargull e98ff6c984 (Shared)ArrayBuffer constructor validation happens in correct order
Add tests to ensure that:
1. First `byteLength` isn't larger than `maxByteLength`.
2. Then `OrdinaryCreateFromConstructor` is called.
3. And finally `Create{Shared}ByteDataBlock` is called.
2024-02-12 14:18:33 +01:00
André Bargull 53984cf8c5
Add test with non-IANA time zone names (#4005)
Time zone identifiers supported by ICU, but which aren't valid IANA
identifiers.

Implementations not supporting ECMA-402 are theoretically allowed to
support these identifiers, so the tests have to go into the "intl402"
directory.
2024-02-12 12:06:04 +01:00
Lucas Mirelmann 403ee414ab
Fix comment in allow-nlt-before-with.js (#4001)
The proposed syntax allows a line terminator before the `WithClause`.
2024-02-09 16:36:41 -08:00
Nicolò Ribaudo 866d24deb2 Improve test robustness 2024-02-09 16:28:05 -08:00
Nicolò Ribaudo 98938f4c0a Add tests for `-->` in the first line 2024-02-09 16:28:05 -08:00
Philip Chimento 49e56acc67 Temporal: Tests for date difference algorithm
This adds tests specifically for every kind of case that changes due to
the tweak to the date difference algorithm: differences from a longer
month to a shorter month, when the months are adjacent, in the same year
but not adjacent, and in different years.

Also adds tests for a case that does *not* change, but would trip on an
incorrectly implemented algorithm: when the intermediate months value
falls at the end of February.

There was incidental coverage of the change to the date difference
algorithm in other tests. Those are adjusted, as well.

Normative change: https://github.com/tc39/proposal-temporal/pull/2759
Consensus in February 2024
2024-02-09 16:03:33 -08:00
Igor Sheludko f742eb092d [test262] Add a new staging test for Array.p.flatMap
Bug: v8:14306
Change-Id: Ibc7a04288a0c31bfcf601aa864e02b6c067045c2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5259306
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#92174}
2024-02-05 15:05:01 +01:00
Philip Chimento 3e7938c1f5 Temporal: Prevent arbitrary loops in NormalizedTimeDurationToDays
Adapts the tests that checked arbitrarily long loops, to now check that an
exception is thrown if the loop would happen.

Adds tests that exercise the newly added checks on return values of
getPossibleInstantsFor and getOffsetNanosecondsFor that limit UTC offset
shifts to 24 hours or less.

Also updates some step numbers in related tests.
2024-02-02 08:43:11 -08:00
Nicolò Ribaudo 584048ed08 Add additional tests for out-of-range date-times
- https://github.com/tc39/proposal-temporal/pull/2727#discussion_r1414066610
- https://github.com/tc39/proposal-temporal/pull/2727#discussion_r1414065876
- https://github.com/tc39/proposal-temporal/pull/2727#discussion_r1414067272
2024-01-31 08:22:05 -08:00
André Bargull 0de91996e7 Add tests for precise results in Duration.p.total and ZonedDateTime.p.hoursInDay
The existing tests didn't cover some edge cases where implementations
have to compute the exact result of `numerator / denominator`, where at
least one of `numerator` and `denominator` can't be exactly represented
by an IEEE-754 double precision floating point value.

"precision-exact-mathematical-values-5.js" gets added in #3961, so the
new tests from this commit start at "precision-exact-mathematical-values-6.js".
2024-01-31 08:22:05 -08:00
Philip Chimento 99d5bc8c1b Temporal: Limit duration years, months, and weeks to <2³² each 2024-01-31 08:22:05 -08:00
Philip Chimento 01ec9938bb Temporal: Limit day length calculations to safe integers
NormalizedTimeDurationToDays can no longer loop indefinitely, because at
a certain point we will hit the upper bound of MAX_SAFE_INTEGER, so rename
the test to reflect that it can loop an arbitrary but limited number of
times.

Add a test for the RangeError condition in NormalizedTimeDurationToDays
when the time zone calculates a day length that is not a safe integer
number of nanoseconds.

While editing these tests, rename them to match the current name of the AO
and make sure the step numbers are up to date. (Normally I wouldn't care
so much about that, but these tests can be pretty confusing so it's good
to be able to refer to the spec text.)
2024-01-31 08:22:05 -08:00
Philip Chimento 092337c8d0 Temporal: Adapt tests to upper bound on time portion of durations
Adapts or removes tests that relied on creating durations that are now out
of range. Adds new tests for maximum in-range and minimum out-of-range
durations.
2024-01-31 08:22:05 -08:00
Michael Ficarra e4f91b6381
fix broken Iterator.prototype constructor/Symbol.toStringTag tests (#3996)
* fix broken Iterator.prototype constructor/Symbol.toStringTag tests

* fix lint: unused includes
2024-01-24 17:37:28 -08:00
Ioanna M. Dimitriou H fed13c1915 Tests using yield*, also to test codepath via .throw()
This includes the test case mentioned in ecma262 issue comment:
https://github.com/tc39/ecma262/issues/1849#issuecomment-576912421

Also using yield* we can test the changes to AsyncFromSyncIteratorContinuation
when called via .throw().
2024-01-23 13:31:50 -08:00
Ioanna M. Dimitriou H 2e44b8f13f Test that the sync iterator called via for-await-of closes
when a rejected promise is returned normally by the iterator.

These tests correspond to this normative changes example:
https://docs.google.com/presentation/d/1W9EJoWOvi6jU1A2bwyixzOceoP_ASAeaOYER3Zy9P00/edit#slide=id.g10c9207737d_0_31
2024-01-23 13:31:50 -08:00
Ioanna M Dimitriou H 1f380f3750
Test closing async-from-sync iterator when resolving result promise abrupt completes. (#3977)
* Test closing async-from-sync iterator when resolving result promise abrupt completes.

These test new steps 6-6.a of AsyncFromSyncIteratorContinuation
as per normative changes of ecma626 PR 2600
https://github.com/tc39/ecma262/pull/2600

* Apply suggestions from code review

Co-authored-by: Kevin Gibbons <bakkot@gmail.com>

* Apply suggestions from code review

Co-authored-by: Nicolò Ribaudo <hello@nicr.dev>

* Refactoring tests to use the Async Helpers.

---------

Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
Co-authored-by: Nicolò Ribaudo <hello@nicr.dev>
2024-01-23 13:26:02 -08:00
Ioanna M Dimitriou H 2c58671789
Async-from-sync test the iterator closes when .throw() is undefined (#3976)
* Adjust existing tests to match new spec for async-from-sync iterators

Testing normative changes of ecma626 PR 2600

* Test that async-from-sync iterator closes when throw is undefined.

These test paths from newly added call to IteratorClose in step 7.c of
 %AsyncFromSyncIteratorPrototype%.throw
as per normative changes of ecma626 PR 2600

* Apply suggestions from code review

Co-authored-by: Jordan Harband <ljharb@gmail.com>

* Refactoring tests to use the Async Helpers.

Addresses review comments
- https://github.com/tc39/test262/pull/3976/files#r1451071569
- https://github.com/tc39/test262/pull/3976/files#r1451075479

---------

Co-authored-by: Jordan Harband <ljharb@gmail.com>
2024-01-23 13:16:58 -08:00
Michael Ficarra 17ba9aea47
update constructor and Symbol.toStringTag properties on Iterator.prototype (#3970)
* update constructor and toStringTag properties on Iterator.prototype

* includes cannot be empty for some reason

* update description

* add esid

* updates

* freeze Iterator.prototype

* don't try to use real GeneratorPrototype for these tests
2024-01-15 15:40:01 -08:00
Nicolò Ribaudo bebce4a5ee Make sure that the test always throws a SyntaxError 2024-01-15 15:16:53 -08:00
Nicolò Ribaudo 8b1bd25b49 Do not expect specific error type in import-attributes/allow-nlt-before-with.js
Hosts are free to throw whatever error they want during module loading: there is no guarantee that the error thrown due to the import with `type: "foo"` is a SyntaxError.
2024-01-15 15:16:53 -08:00
Justin Grant a1ba783ca3 Add 402 staging tests: Islamic & Persian calendars
Tests the changes in https://github.com/tc39/proposal-temporal/pull/2743
2024-01-12 16:42:31 -08:00
Kevin Gibbons 9c4e0fd902
introduce nonClampedIntArrayConstructors (#3984) 2024-01-11 11:35:28 +01:00
Rezvan Mahdavi Hezaveh 080f11f2ad The difference between two sets is `[1]`. 2024-01-11 00:23:14 +00:00
Kevin Gibbons c8cd136888
More set methods tests (#3966)
* add tests for difference, intersection, symmetricDifference

* add tests for predicates

* more tests for ordering of calls

* fix copyrights

* add missed -0 test

* pass argument to methods, not just this

* assert methods return new objects

* typo in filename

* fix parens

* Update test/built-ins/Set/prototype/difference/add-not-called.js

Co-authored-by: Jordan Harband <ljharb@gmail.com>

* fix isSupersetOf/set-like-array.js

* add tests for negative zero with isDisjointFrom and isSupersetOf

* fix message in isSupersetOf/converts-negative-zero.js

* address comments from review

---------

Co-authored-by: Jordan Harband <ljharb@gmail.com>
2024-01-10 12:52:41 -08:00
Ben Allen 80590ce79a Added tests to verify that use of "long", "short", or "narrow" styles for units following units using "numeric" or "2-digit" styles throws 2024-01-10 14:50:08 +01:00
Kevin Gibbons 67a5153cf5
add Float16Array to all generic TypedArray tests (#3849) 2024-01-10 14:07:57 +01:00
Kevin Gibbons 5a263f5b19 add the TypedArray feature flag to some tests which were missing it 2024-01-08 17:21:46 -08:00
Michael Dyck 816b6b14d8 Delete trailing space from "info: |" lines 2024-01-08 16:04:41 +01:00
Michael Dyck c194ad6936 Delete extra slash in Copyright section 2024-01-08 16:04:41 +01:00
Jordan Harband 4393acd575 Array length: add test ensuring RangeError is thrown 2024-01-08 15:41:52 +01:00
Lucas Mirelmann b628e4b054 Update single-line-html-close.js
Fix comment with the description of the syntax
2023-12-18 09:42:42 -05:00
Philip Chimento 6cbb6da947 Temporal: Change overflow behaviour of PYM/PMD.toPlainDate
These tests cover the proposed normative change:
https://github.com/tc39/proposal-temporal/issues/2706
2023-12-04 14:59:58 -08:00
Linus Groh 32540f3034 Fix property name in Atomics.isLockFree() descriptor test 2023-12-04 13:48:06 +01:00
Rezvan Mahdavi Hezaveh 467a0fe68f [test262] Add staging tests for isSubsetOf set method
This CL adds three tests to staging directory of test262.

Bug: v8:13556
Change-Id: Id6e468a0fa29528350a10c94e9dd19c2835788e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5055866
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Liviu Rau <liviurau@google.com>
Cr-Commit-Position: refs/heads/main@{#91139}
2023-11-27 18:49:17 +01:00
Richard Gibson 2060494f28 Test for assignment with target wrapped in two sets of parentheses 2023-11-21 09:51:03 -05:00
Kevin Gibbons 718aa71683 Consolidate set methods features 2023-11-20 09:17:29 +01:00
Philip Chimento 27a7501893 Temporal: Limit year, month, and week length calculations to nonzero
Tests with conditions that would trip a division by zero in
implementations if they didn't carefully implement the spec.
2023-11-16 11:08:42 -08:00
Philip Chimento bcb409148d Temporal: Remove loops in RoundDuration 2023-11-16 11:08:42 -08:00
Philip Chimento e43e20a885 Temporal: Remove BigInt arithmetic and loops in BalanceDurationRelative
A few results change because the algorithm previously used for rounding
didn't always add duration units to dates in RFC 5545 order, and we also
introduce a special case for rounding with largestUnit years or months and
smallestUnit weeks.
2023-11-16 11:08:42 -08:00
Philip Chimento 50abc12d97 Temporal: Remove BigInt arithmetic and loops in UnbalanceDurationRelative 2023-11-16 11:08:42 -08:00
Anthony Frehner 60310b70bc
Add Set.prototype.union tests (#3816)
* Beginning of adding Set.prototype.union tests

* Fix description

* Add tests for GetSetRecord

Which also allows Set-like objects

* Add title to test descriptions

* Add test for ensuring values are appended

* Add tests for properties of union

Also: tests for RequireInternalSlot, Constructor, BuiltIns.

Added a test to ensure that -0F is converted to +0F

* Ensure Set.prototype.add is not called as part of .union

* fix lint issues

* Set subclassing and Symbol.species tests

* Set.prototype.union tests for arrays and subclass methods

* Add the Set-methods frontmatter feature flag

* Add additional Set.prototype.union test for edge cases

* Update test/built-ins/Set/GetSetRecord/keys-is-callable.js

Co-authored-by: Kevin Gibbons <bakkot@gmail.com>

* Use compareArray() for assertions

* Remove class field syntax

* Remove unused args

* Update test/built-ins/Set/prototype/union/subclass-receiver-methods.js

Co-authored-by: Jordan Harband <ljharb@gmail.com>

* Return original 'add'

* address comments

* add one more mutation in the evil mutating iterator test

* address further comments

---------

Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
Co-authored-by: Ms2ger <Ms2ger@igalia.com>
2023-11-15 17:55:47 +01:00
Philip Chimento 5962be6d66 Temporal: Combine expected relativeTo operations for readability in Duration.compare
Code review suggestion from Richard.
2023-11-14 11:44:00 -08:00
Philip Chimento dc1c787cc8 Temporal: Make calendar method lookups unconditional
See https://github.com/tc39/proposal-temporal/issues/2724
2023-11-14 11:44:00 -08:00
Philip Chimento 3e23610431 Temporal: Make time zone method lookups unconditional
See https://github.com/tc39/proposal-temporal/issues/2724
2023-11-14 11:44:00 -08:00
Philip Chimento 7c41695f78 Adjustments to tests for added invocations of BalanceDurationRelative
In order to fix tc39/proposal-temporal#2563, we added invocations of
BalanceDurationRelative after some invocations of RoundDuration. These
cause observable calendar calls, which must be accounted for in some
existing tests.
2023-11-14 10:03:45 -08:00
Philip Chimento 93304c7571 Tests for Duration rounding bug when rounding crosses a unit boundary
See https://github.com/tc39/proposal-temporal/issues/2563

The old behaviour was encoded in one test in staging, but the behaviour of
largestUnit in duration rounding has changed since that test was written.
Therefore I'm assuming that toString() should've been updated when that
happened.
2023-11-14 10:03:45 -08:00
Frank Tang 96727cae1c Add test for firstDayOfWeek in LocaleInfo PR 70
Test for enhancement in
https://github.com/tc39/proposal-intl-locale-info/pull/70
2023-11-10 18:11:03 -08:00
André Bargull 873f260478 Update likely subtags tests for CLDR 44 2023-11-08 13:48:33 +01:00
André Bargull 4d44acbc03 Update case folding tests for Unicode 15.1
Unicode 15.1 added the following "simple" case-folding entries:
```
1FD3; S; 0390; # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA
1FE3; S; 03B0; # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA
FB05; S; FB06; # LATIN SMALL LIGATURE LONG S T
```
2023-11-08 13:43:44 +01:00
Ben Allen 99ac701b43
Test invalid region tags in Intl.DisplayNames.prototype.of() (#3900) 2023-11-07 15:09:53 +01:00
Philip Chimento 2a804d6c33 Temporal: Avoid extra Zoned→Plain conversion in AddDuration
Two more test cases for a fast path that previously wasn't tested.
2023-11-06 14:46:36 -08:00
Philip Chimento c5dd01f7c0 Temporal: Look up calendar methods only once 2023-11-06 14:46:36 -08:00
Philip Chimento 911fe9612e Temporal: Look up time zone methods only once 2023-11-06 14:46:36 -08:00
Veera c1281dba45 Test for Unicode Escape in Literals 2023-10-31 16:57:41 -07:00
Liviu Rau 8162f8c58f [test262] Add set method tests to staging
Reland https://crrev.com/c/4913993

This CL adds three tests from test methods tests to staging
directory with correct format.

Bug: v8:13556
Change-Id: I93817eb84e077436071dbae98bc800dd58851f91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4983674
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Liviu Rau <liviurau@google.com>
Cr-Commit-Position: refs/heads/main@{#90645}
2023-10-27 19:28:54 +02:00
Nicolò Ribaudo 0a6dabf1e2 Add readmes 2023-10-26 18:21:19 -07:00
Nicolò Ribaudo 41515e87e5 Use import-attributes flag in new generated tests 2023-10-26 18:21:19 -07:00
Nicolò Ribaudo 3ddb9e5e95 Update import attributes tests to use the `with` keyword 2023-10-26 18:21:19 -07:00
Nicolò Ribaudo 06f6ae960a Copy all import assertions tests as a basis for import attributes tests 2023-10-26 18:21:19 -07:00
Philip Chimento 892a5dccd2 Temporal: Use propertyBagObserver in monthDayFromFields test 2023-10-26 12:37:43 -04:00
Philip Chimento f4377a7cf0 Temporal: Fix test to check for TypeError with only one of era/eraYear
These tests were incorrect, in checking for a RangeError when only one of
the era/eraYear fields were given. From CalendarResolveFields:

"The operation throws a *TypeError* exception if the properties of
_fields_ are internally inconsistent within the calendar or insufficient
to identify a unique instance of _type_ in the calendar."
2023-10-26 12:37:43 -04:00
Philip Chimento dab8ccc5df Temporal: Add more coverage for non-ISO PlainMonthDay underspecification
Built-in non-ISO calendars require either monthCode/day, or month/day plus
some form of year specification.

This adds test coverage for each of the categories listed in
https://github.com/tc39/proposal-temporal/issues/2664, of which some must
currently reside in the test/intl402/ folders.
2023-10-26 12:37:43 -04:00
Philip Chimento 8bc3dbb234 Temporal: Move non-ISO calendar tests to intl402/
We'll do this for now, then separately work on migrating all of the tests
that require a non-ISO8601 calendar but aren't dependent on it being any
particular calendar.
2023-10-26 12:37:43 -04:00
Richard Gibson 5c629683f2 Temporal: Update PlainMonthDay-related tests
As of https://github.com/tc39/proposal-temporal/pull/2500 ,
year is always optional for the ISO 8601 calendar.
2023-10-26 12:37:43 -04:00
Philip Chimento 96bc38f5d9 Temporal: Exhaustive coverage for compare() methods
This adds coverage for each possible outcome of compare(), where each unit
is greater, lesser, or equal.
2023-10-18 09:27:24 -07:00
Philip Chimento 1f0fc4e0ad Temporal: Tests for PlainDateTime exposed in DisambiguatePossibleInstants
In the AO DisambiguatePossibleInstants, a PlainDateTime instance is passed
to user code. This instance should have the built-in ISO 8601 calendar.
Here are some tests that ensure it does.

See tc39/proposal-temporal#2671.
2023-10-18 09:27:24 -07:00
Philip Chimento 70c36b6584 Temporal: Tests for dates out-of-range when finding end of month
In PlainYearMonth arithmetic, we need to find the end of the month when
adding a negative duration or subtracting a positive one. This end of the
month can be out of range.

Test case based on one provided by Anba. See issue:
https://github.com/tc39/proposal-temporal/issues/2700
2023-10-18 09:27:24 -07:00
Philip Chimento 0b75d626b9 Temporal: Tests for durations out-of-range when added to relativeTo
Test case based on one provided by Anba. See issue:
https://github.com/tc39/proposal-temporal/issues/2697
2023-10-18 09:27:24 -07:00
André Bargull f0c16faee2 Fix symbol-tag-generators-builtin.js
Two issues:
1. There was a typo, the first `gen` should have been `genFn`.
2. And the last `toString` result should be `'[object Generator]'`,
   because `Object.getPrototypeOf(gen) == genFn.prototype`. And the
   `@@toStringTag` property of `genFn.prototype` is inherited from
   `Generator.prototype[@@toStringTag]`.

That also means the "iterator-helpers" flag isn't needed for this test.
2023-10-10 15:44:17 +02:00
Jordan Harband e0436fc52d Object.prototype.toString: improve coverage 2023-10-05 12:15:27 -07:00
Jordan Harband 45d52b90ee Object.prototype.toString: split Symbol.toStringTag tests into separate files
See https://github.com/tc39/test262/pull/3855#issuecomment-1593543655
2023-10-05 12:15:27 -07:00
Daniel Minor 55e8cceb80 Revert "Revert "Fixup class names in class decorator private identifier tests.""
This reverts commit 31f703cbe69ec2e0fd4b94de2fdf505fb722b552.

The changes are needed to both the templates and the generated files.
2023-10-05 10:23:12 -07:00
Daniel Minor 3ef0777c04 Revert "Fixup class names in class decorator private identifier tests."
This changed the test files, not the templates used to generate the tests.
2023-10-05 10:23:12 -07:00
Daniel Minor 581de2d0f8 Fixup class names in class decorator private identifier tests.
For the statement level test, the inner class name is not initialized
at the time the decorators evaluate, resulting in a ReferenceError
that the declaration can not be accessed prior to initialization.

Similar, non-decorator code, like:
    class C {
        static dec() {}
        static {
            this.x = C.dec();
            class C {}
        }
    }
also results in a ReferenceError.

For the expression level test, the var C is undefined at the time the
decorators are evaluated, resulting in TypeError while trying to access
a member of undefined.

Similar, non-decorator code, like:
    var C = class {
        static f() {};
        static {
            this.x = C.f();
        }
    }
also results in a TypeError.
2023-10-05 10:23:12 -07:00
Philip Chimento dceb204259 Temporal: Tests for absolute value bug in duration rounding no-op conditions
Repeat all the existing tests for no-op duration rounding operations, but
with negative durations.
2023-10-04 15:35:39 -07:00
Philip Chimento c04b417f66 Temporal: Precalculate PlainDateTime from ZonedDateTime in more places 2023-10-04 15:35:39 -07:00
Philip Chimento 3a57a424e0 Temporal: Look up getOffsetNanosecondsFor only once when resolving ambiguous datetime 2023-10-04 15:35:39 -07:00
Philip Chimento 9b8d9cf66c Temporal: Fast-path dateUntil() when difference largest unit is days
This removes several loopholes where it was possible to return particular
values from user calls that would cause infinite loops, or calculate
zero-length days.
2023-10-04 15:35:39 -07:00
Philip Chimento 7a3944c0cc Temporal: Fast-path differences between identical objects 2023-10-04 15:35:39 -07:00
Philip Chimento 34ce4bd53a Temporal: Fast-path dateAdd() when adding only days 2023-10-04 15:35:39 -07:00
Philip Chimento da3dd8802f Temporal: Avoid calendar operations when adding days-only duration to PlainDate 2023-10-04 15:35:39 -07:00
Philip Chimento b5a5b283a3 Temporal: Fast-path AddDaysToZonedDateTime in AddZonedDateTime 2023-10-04 15:35:39 -07:00
Philip Chimento 8040379076 Temporal: Avoid calendar operations when adding days-only duration to ZDT
This allows removing several tests, as calendar.dateAdd() is no longer
called in several places, and it's no longer possible to create a
situation where BigInt arithmetic is observable in NanosecondsToDays.
2023-10-04 15:35:39 -07:00
Ben Allen d2a6e21ff9 added missing features: line to metadata for two tests 2023-10-04 15:06:25 -07:00
Ben Allen 47eb8dd685
Update to reflect normative change in formatting when Intl.DurationFormat's fractionalDigits option is undefined (#3890) 2023-10-03 13:32:13 +02:00
Ben Allen 5e6f25bb4f added clarifying comments on hourCycle-dateStyle.js 2023-10-02 14:39:52 -07:00
Ben Allen 5606c3012e corrected hourCycle-default.js to handle language tags with -u-hc-h24 extension 2023-10-02 14:39:52 -07:00
Ben Allen 800d136d96 updated hourCycle-default.js to reflect new behaviour of hourCycle, which now associates h12 with h23 rather than h24. see https://github.com/tc39/ecma402/pull/758. 2023-10-02 14:39:52 -07:00
Ben Allen 63456adb38 created type-language-invalid.js for DisplayNames.prototype.of()
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
2023-10-02 14:01:04 -07:00
André Bargull 9f5938bc15 Fix harness tests for verifyProperty 2023-10-02 11:27:59 +02:00
Alexey Shvayka be53234590
Test that `HasVarDeclaration` accounts for bindings created via `eval()` (#3914)
Co-authored-by: Alexey Shvayka <ashvayka@apple.com>
2023-09-28 18:16:33 +02:00
Frank Yung-Fong Tang 6789b50cce
Add test for ECMA402 PR 788 (#3917)
* Add test for ECMA402 PR 788

https://github.com/tc39/ecma402/pull/788

* Fix misunderstanding about "+00:00"

* Fix lint

* Swap actual, expected position

* Update test/intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-change.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update test/intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-basic.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update test/intl402/DateTimeFormat/prototype/formatToParts/offset-timezone-correct.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update test/intl402/DateTimeFormat/constructor-invalid-offset-timezone.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update test/intl402/DateTimeFormat/constructor-invalid-offset-timezone.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update test/intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-change.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update test/intl402/DateTimeFormat/constructor-invalid-offset-timezone.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update test/intl402/DateTimeFormat/prototype/format/offset-timezone-gmt-same.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update test/intl402/DateTimeFormat/prototype/format/offset-timezone-gmt-same.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update test/intl402/DateTimeFormat/prototype/formatToParts/offset-timezone-correct.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

---------

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
2023-09-26 09:22:50 -07:00
Frank Yung-Fong Tang b5fd799fa0
Add Tests for ECMA402 PR811 (#3911)
* Add Tests for ECMA402 PR811

Add tests to check the order of option readings and output
keys in resolvedOptions of Intl.NumberFormat and PluralRules.

* Address reveiw feedback

Hard code the list of property to be inspect for GetOption
Use compareArray

* Update test/intl402/NumberFormat/constructor-option-read-order.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update test/intl402/NumberFormat/constructor-option-read-order.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update test/intl402/NumberFormat/prototype/resolvedOptions/return-keys-order-default.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update test/intl402/PluralRules/constructor-option-read-order.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update test/intl402/PluralRules/constructor-option-read-order.js

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Fix intl402/PluralRules/prototype/resolvedOptions/return-keys-order-default.js

To test all options

* Add more tests

---------

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
2023-09-26 08:58:27 -07:00
André Bargull 989377d62d Fix import assertions tests
- Correct file paths in "ensure-linking-error_FIXTURE.js"
- Remove no longer valid assertion in "import-assertion-empty.js".

See also #3919.
2023-09-25 08:33:51 -07:00
André Bargull 16fc2e5e18 Use correct variables in time zone case insensitive test
Also remove `US/Pacific-New` which has been removed from tz data since
release 2020b.
2023-09-22 09:02:08 -07:00
Shu-yu Guo dd30d83e9e Fix 'wrtiable' typos 2023-09-19 17:09:33 -07:00
Rezvan Mahdavi Hezaveh 79f087814f
Update two constructor tests of Array.fromAsync (#3926)
* Update two constructor tests of Array.fromAsync

* Remove extra comment

---------

Co-authored-by: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
2023-09-18 17:45:49 -07:00
Mathias Bynens 59bad89898
Add Unicode v15.1.0-sensitive `IdentifierPart` tests (#3833)
Ref. https://github.com/tc39/ecma262/issues/3073
2023-09-15 12:27:42 +02:00
Frank Yung-Fong Tang 3c9b3913b2
Add Collator test for ignorePunctuation (#3913)
Test the explicit setting of ignorePunctuation in the option bag
reflect to the value in resolvedOptions() under Thai and
other locales. (Thai is a special case)

Test the behavior of the compare sync with the value of
resolvedOptions().ignorePunctuation
2023-09-13 17:48:22 +02:00
André Bargull 1bd99bf069 Remove excess leading whitespace 2023-09-13 16:05:40 +02:00
André Bargull c140af3cb3 Update other test/language tests to use verifyProperty 2023-09-13 16:05:40 +02:00
André Bargull a7ee7473b7 Use verifyProperty in language/arguments-object tests 2023-09-13 16:05:40 +02:00
André Bargull f2275d23f4 Use verifyProperty in language/literals tests 2023-09-13 16:05:40 +02:00
André Bargull e6f1feb04d Use verifyProperty in language/global-code tests 2023-09-13 16:05:40 +02:00
André Bargull 8ff30c73ce Use verifyProperty in language/eval-code tests 2023-09-13 16:05:40 +02:00
André Bargull 08a7b9d4b6 Use verifyProperty in language/expressions tests 2023-09-13 16:05:40 +02:00
André Bargull ff81dccfc3 Use verifyProperty in language/statements tests 2023-09-13 16:05:40 +02:00
André Bargull 99096762ca Use verifyProperty in remaining test/intl402 tests 2023-09-13 16:05:40 +02:00
André Bargull f32dc36f3e Use verifyProperty in test/intl402/PluralRules tests 2023-09-13 16:05:40 +02:00
André Bargull ad3f1a6ade Use verifyProperty in test/intl402/NumberFormat tests 2023-09-13 16:05:40 +02:00
André Bargull fe2c17bf4b Use verifyProperty in test/intl402/DateTimeFormat tests 2023-09-13 16:05:40 +02:00
André Bargull 967b16500a Use verifyProperty in test/intl402/Collator tests 2023-09-13 16:05:40 +02:00
André Bargull 534decc36d Fix typos in calls to verifyProperty
And update verifyProperty to catch misspelled descriptor fields.
2023-09-13 16:05:40 +02:00
Frank Tang bba19d51ae Sync Intl Locale API tests w/ PR67
https://github.com/tc39/proposal-intl-locale-info/pull/67
2023-09-13 16:01:07 +02:00
Nicolò Ribaudo 1bb53aee3e
Update import attributes `assert` tests to current semantics (#3919)
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2023-09-13 11:35:06 +02:00
Philip Chimento e98bfb332e Temporal: Do away with CalculateOffsetShift in Duration.compare 2023-09-13 10:57:43 +02:00
Philip Chimento 5972c16b07 Temporal: Return early from Duration.compare if internal slots equal 2023-09-13 10:57:43 +02:00
Philip Chimento 80958c3267 Temporal: Avoid reconverting Zoned- to PlainDateTime in AddZonedDateTime 2023-09-13 10:57:43 +02:00
Philip Chimento a74fbada42 Temporal: Don't observably iterate array in built-in calendar's fields()
Note the monkeypatch of getPossibleInstantsFor in test/built-ins/Temporal/
TimeZone/prototype/getInstantFor/argument-builtin-calendar-no-array-
iteration.js.

Other than that, all the tests are basically identical.
2023-09-13 10:57:43 +02:00
Philip Chimento fdd44e2ea5 Temporal: Separate zoned and plain operations in RoundDuration
Adds new tests to order-of-operations.js in Duration.round and
Duration.total, to exercise the code path where previous to this normative
change, relativeTo would have been converted to PlainDate 3x and 2x,
respectively.
2023-09-13 10:57:43 +02:00
Philip Chimento 008b97932b Temporal: Don't convert relativeTo to PlainDate twice in Duration.compare 2023-09-13 10:57:43 +02:00
Philip Chimento 0a6341de65 Temporal: Call user code on relativeTo only when necessary in RoundDuration 2023-09-13 10:57:43 +02:00
Philip Chimento f44bbe4035 Temporal: Avoid calling user code in no-op round operations
This shortcut path now exists in all round(), since(), and until()
operations.
In Instant, PlainDate, PlainDateTime, and PlainTime, the change isn't
observable, so no tests could be added. This adds test coverage for

- Duration.p.round()
- PlainYearMonth.p.since()
- PlainYearMonth.p.until()
- ZonedDateTime.p.round()
- ZonedDateTime.p.since()
- ZonedDateTime.p.until()

As well as a few cases where we are testing that certain calendar methods
get called during a round operation, but previously were doing so with
options that now become a no-op and no longer call those calendar methods.
In those cases, round to 2 ns, rather than 1 ns.
2023-09-13 10:57:43 +02:00
Peter Klecha 1db9a49eb9 address comments 2023-09-08 16:31:50 -07:00
Peter Klecha 2a4c458002 Update test/built-ins/Promise/withResolvers/ctx-ctor.js
Co-authored-by: Linus Groh <mail@linusgroh.de>
2023-09-08 16:31:50 -07:00
Peter Klecha 998f811e58 Update test/built-ins/Promise/withResolvers/ctx-non-ctor.js
Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2023-09-08 16:31:50 -07:00
Peter Klecha 15e0933cb5 Update test/built-ins/Promise/withResolvers/result.js
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2023-09-08 16:31:50 -07:00
Peter Klecha 8f8aa971d8 Update test/built-ins/Promise/withResolvers/result.js
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2023-09-08 16:31:50 -07:00
Peter Klecha ab0d665192 Update test/built-ins/Promise/withResolvers/result.js
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2023-09-08 16:31:50 -07:00
Peter Klecha d2ac342089 include esids 2023-09-08 16:31:50 -07:00
Peter Klecha 81ba258677 add tests for Promise.withResolvers proposal 2023-09-08 16:31:50 -07:00
Philip Chimento e04e1c1a39 Temporal: Fix front matter of Temporal/ZonedDateTime/p/round/order-of-operations.js 2023-09-08 09:38:14 -07:00
Philip Chimento 6371be8338 Temporal Helpers: Add harness tests for DST sample time zone
Just to make sure the time zone arithmetic matches the actual time zone
that it is based on.
2023-09-08 09:38:14 -07:00
Philip Chimento d03ed25a21 Temporal Helpers: Refactor sample time zone tests in harness tests
These two can be combined into one test, since they are very similar. This
will allow testing the sample DST time zone as well, which is not yet
tested.
2023-09-08 09:38:14 -07:00
Philip Chimento d4f49b84ab Temporal: Update outdated test descriptions 2023-09-08 09:38:14 -07:00
Philip Chimento 6c16577f34 Temporal: Remove unused variables
These are also leftovers from the recent refactor, I think.
2023-09-08 09:38:14 -07:00
Philip Chimento ce92940645 Temporal: Improve various assertion messages
Some of these were overlooked in a recent big refactor.
2023-09-08 09:38:14 -07:00
Mathias Bynens 1a0b9d23f2 Add tests ensuring the latest Unicode Emoji standard is being followed
The behavior of `/\p{RGI_Emoji}/v` and other properties of strings depends on the Unicode & Emoji version being used in the JavaScript engine. This patch adds tests verifying new additions to `RGI_Emoji` for each release of the Unicode Emoji standard are correctly matched.
2023-08-28 16:31:57 +02:00
André Bargull e27c9f690c Add DurationFormat test for negative durations 2023-08-28 16:18:47 +02:00
André Bargull fa3581986f Add test for numeric hours with zero minutes and non-zero seconds 2023-08-28 16:18:47 +02:00
André Bargull c9548956f9 Test exact precision for DurationFormat
`Intl.DurationFormat` is currently spec'ed to use unlimited precision.

See: https://github.com/tc39/proposal-intl-duration-format/issues/157
2023-08-28 16:18:47 +02:00
André Bargull 71091f1541 Use simplified PartitionDurationFormatPattern to computed expected results 2023-08-28 16:18:47 +02:00
André Bargull 4da0b8f005 Remove test which duplicates 'style-default-en.js' 2023-08-28 16:18:47 +02:00
Jordan Harband eb613f6891 use proper isConstructor check for recently added ArrayBuffer/SharedArrayBuffer tests 2023-08-25 15:31:27 +02:00
Michael Ficarra 9efb4f8e53 update iterator helpers tests that passed even in noncompliant impls 2023-08-24 13:09:05 -07:00
André Bargull e273cd470a Add tests for recursively calling IteratorHelper generators 2023-08-24 12:44:04 -07:00
Kevin Gibbons 8a7b686502 add test for regexp matching with zero-length quantified matches 2023-08-24 10:47:01 +02:00
Yusuke Suzuki 04a84fc5fd Fix test/intl402/DurationFormat/prototype/format/style-digital-en.js
The expected output is not aligned: it is missing comma. This change fixes it.
2023-08-21 15:37:04 -07:00
Aditi bdddd9e2d2 Update test for monthDayFromFields() 2023-08-21 09:14:43 -07:00
Philip Chimento c30aff08af Temporal: Copy options object in Plain{Date,MonthDay,YearMonth}.{from,p.with} 2023-08-16 14:49:15 -07:00
Philip Chimento 5ecb902a0a Temporal: Copy options object in {Plain,Zoned}DateTime.{from,p.with} 2023-08-16 14:49:15 -07:00
Philip Chimento 01a49502f6 Temporal: Get receiver fields from a PlainDateTime in ZonedDateTime.with() 2023-08-16 14:49:15 -07:00
Philip Chimento 4155594804 Temporal: Get receiver's time units from internal slots in with() 2023-08-16 14:49:15 -07:00
Philip Chimento 4b4de778d4 Temporal: Limit allowed values for Calendar.fields to date units 2023-08-16 14:49:15 -07:00
Philip Chimento c372de0bbe Temporal: Avoid recalculating offset ns after GetPlainDateTimeFor 2023-08-16 14:49:15 -07:00
Justin Grant 0c87a86b58 Disallow sub-minute annotations in Instant strings
Adds tests that verify that Instant strings cannot include offset time
zone annotations with sub-minute units.

Also removes a few staging test cases that, due to a polyfill bug, were
incorrectly passing.
2023-08-10 15:45:34 +02:00
Justin Grant 2e4e0e6b8e Test ISO sub-minute offsets, incl. trailing zeroes
Plugs a test hole where we were not fully testing ISO strings with
sub-minute offsets, in particular those with trailing zeroes.
2023-08-10 10:13:27 +02:00
Ben Allen 1499c2c62b updated to contain ES5 version of RGN suggestion 2023-08-09 12:18:42 -07:00
Justin Grant 66f3959c14 Remove a sub-minute offset test
There was one remaining Temporal test that was parsing an ISO string
with a sub-minute offset into a Temporal.TimeZone. A polyfill bug was
allowing this test case to pass, even though after
tc39/proposal-temporal#2607 it should have failed.

This commit removes the bad test case.
2023-08-09 11:37:39 -07:00
Justin Grant 2e1d7a72ff Test rejecting ISO strings with subminute offsets
This commit verifies that ISO strings with sub-minute offsets cannot
be parsed into time zone identifiers. This was a change introduced in
the recently-merged tc39/proposal-temporal#2607, but tests for this case
were missing from #3862 (the tests for that PR).

I noticed in codecov results on an unrelated PR that this case wasn't
being tested, so fixing that mistake now.
2023-08-09 11:37:39 -07:00
Justin Grant 29dde1ce0e Tests for new API Temporal.TimeZone.p.equals 2023-08-07 15:01:16 -07:00
Justin Grant 90f5cac987 Add Intl.DTF tests for proposal-canonical-tz 2023-08-07 15:01:16 -07:00
Justin Grant a53f190e1f Add ZonedDateTime tests for proposal-canonical-tz 2023-08-07 15:01:16 -07:00
Justin Grant 3032242269 Test Temporal.TimeZone ID case normalization 2023-08-07 15:01:16 -07:00
Justin Grant 5d261f3641 Fix existing tests broken by proposal-canonical-tz 2023-08-07 15:01:16 -07:00
Ben Allen a5e2cf2433
Update InitializeDateTimeFormat references to new CreateDateTimeFormat to reflect recent editorial change (#3889) 2023-08-07 17:01:48 +02:00
Ben Allen 5d9dc53a19
Test invalid Intl.DateTimeFormat options when dateStyle/timeStyle is set (#3886)
Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2023-08-07 16:32:44 +02:00
André Bargull 21c3097f92 Update tests for PR "Read date-time options only once when creating DateTimeFormat objects"
Update tests for PR tc39/ecma402#709.
2023-07-27 21:08:25 +02:00
Justin Grant 425716345f Test Temporal.Instant w/ trailing zeroes in offset
I noticed a small test hole in codecov: we weren't testing
Temporal.Instant parsing with trailing zeroes in the offset.
I also didn't see fractional offset testing, so added that too.
2023-07-27 12:52:25 +02:00
Justin Grant c84752415d Test PlainTime without full ISO strings
Codecov showed that PlainTime strings like "09:00:00Z[UTC]" or
"09:00:00Z" were not being tested. This commit fills that gap.

It'd probably be good to make similar changes for other Plain* types,
but Codecov didn't complain about them so they may be covered
via other tests so it was less urgent.
2023-07-25 09:36:18 +02:00
Justin Grant e8bbfe704f Ensure that non-string TimeZone IDs will throw
This commit fills a test hole found by Codecov: we weren't checking for
the case of a custom time zone whose `id` property returns a non-string
value.

Note that the `id` property is only read in a few places, all on the
ZonedDateTime prototype: `until`, `since`, `equals`, `toString`,
`toLocaleString`, `toJSON`, and `timeZoneId`.
2023-07-25 09:30:37 +02:00
Frank Yung-Fong Tang 92a9eca159
Add tests for ECMA402 PR 786 (#3875)
https://github.com/tc39/ecma402/pull/786

This ECMA402 PR 786 reached TC39 consensus in the July 2023 meeting
2023-07-24 17:47:19 +02:00
Justin Grant 6f146e6f30 Limit offset time zones to minute precision
Modify/add tests for https://github.com/tc39/proposal-temporal/pull/2607
2023-07-18 17:44:19 +02:00
Justin Grant 60e475248d Tests for Temporal PR #2574
Edits Temporal tests to account for changes in
https://github.com/tc39/proposal-temporal/pull/2574.

This PR stops coercing non-string primitive inputs to strings
in Temporal methods, to avoid cases where numbers
are coerced to syntactically valid but often unexpected
string results.
2023-07-18 17:09:04 +02:00
Guillaume Emont 016e4bf8e8
Temporal Issue 2532 (#3858)
* Add tests for the new PrepareTemporalFields behavior for all direct callers

See https://github.com/tc39/proposal-temporal/pull/2570

* Add tests for the new PrepareTemporalFields behavior for indirect callers through ToTemporalDate

* Add tests for the new PrepareTemporalFields behavior for indirect callers through ToTemporalDateTime

* Add tests for the new PrepareTemporalFields behavior for indirect callers through ToTemporalZonedDateTime

* Add tests for the new PrepareTemporalFields behavior for indirect callers through ToTemporalYearMonth

* Add tests for the new PrepareTemporalFields behavior for indirect callers through ToTemporalMonthDay

* Add tests for the new PrepareTemporalFields behavior for indirect callers through ToRelativeTemporalObject

* Add tests for the new PrepareTemporalFields behavior for indirect callers through AddDurationToOrSubtractDurationFromPlainYearMonth
2023-07-17 07:55:34 -07:00
Nicolò Ribaudo 7ef1833109 Move all tests using import assertions to files named as such 2023-07-17 16:32:25 +02:00
Frank Tang 9d7eb8018e Correct DurationFormat test
The expectation values for the formatToParts are incorrect.

A. The listFormat is consturcted with
  6. Perform ! CreateDataPropertyOrThrow(lfOpts, "type", "unit").
  so it should not have " and " in the string. Comparing with
  (new Intl.ListFormat("en", {type: "unit"})).formatToParts(["a", "b",
  "c"]) and
  value in the format d and the expected values in the
  DurationFormat/prototype/format directory
B. The localized unit values for "short" (and therefore default)
   are incorrect. Comparing with the expected values in the
  DurationFormat/prototype/format directory
2023-07-14 19:13:30 +02:00
Michael Ficarra 550c11163e
add tests for tc39/proposal-iterator-helpers#281 (#3869)
Co-authored-by: Ms2ger <Ms2ger@igalia.com>
2023-07-13 16:04:33 +02:00
André Bargull 8ce9864511 Add copy of transfer/transferToFixedLength tests with resizable-arraybuffer features removed 2023-07-03 15:10:04 +02:00