* Temporal: Tests for duration rounding and totaling
This provides coverage for the bug in https://github.com/tc39/proposal-temporal/issues/3168
* Update test/built-ins/Temporal/Duration/prototype/total/rounding-window.js
---------
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
Tests analogous to the Gregorian-like ones in the previous commit. For
example, when taking the difference between day 30 of a 30-day month and
day 29 of the following 29-day month, the result should be unambiguous
with respect to constraining: 29 days, not 1 month.
The name is confusing. It was intended to apply to all Gregorian-like
non-ISO calendars but when adding more calendar tests it seems to be
convenient to put each calendar's tests in their own file.
Use appropriate arithmetic years for each of the calendars.
Adds coverage for the constrain behaviour around leap months when using
the with() method to change the year, for the three calendars with leap
months.
There was some coverage for mutually exclusive fields (month/monthCode,
and era+eraYear/year). This expands it to cover all supported calendars
and for PlainDateTime/ZonedDateTime as well.
Reorganize the PlainDate.p.add tests by topic ("basic arithmetic", "leap
years") to make them easier to adapt for non-ISO calendars. A third
topic would be "constraining days" but it turns out that is barely
tested!
This adds tests for overflow constrain/reject with years, expands the
coverage with months to test edge cases using 12, 13, 24, and 25 months,
and cleans up a bit.
I started to add weeks and days tests for this in the previous PR, but
on reflection I don't think those are that useful.
This adds tests for overflow constrain/reject with years, expands the
coverage with months to test edge cases using 12, 13, 24, and 25 months,
and cleans up a bit.
Note the tests adding a number of years to get from a leap month in one
year to the same leap month in another year! 2012 has M04L in the
Chinese calendar and M03L in the Dangi calendar, so these are different
between the two calendars.
Tests how Intl.DateTimeFormat formats eras in various calendars. The
actual output is implementation-defined, but we can test a few things:
- Calendars with multiple eras have distinct values for the era part
when formatting dates in each era.
- Calendars with one era have the same value for the era part when
formatting dates with positive and negative era years.
- Calendars without eras do not include an era part in the format.
Some calendars are missing from this test because their era
configurations were updated in CLDR 48. I will add those in a separate
PR which can be merged when implementations have had more time to update
to that version of CLDR.
Co-Authored-By: Philip Chimento <pchimento@igalia.com>
This test calls Intl.DateTimeFormat.prototype.formatToParts() and
format() on dates in lunisolar calendars in leap and non-leap months.
The actual output is implementation-defined so there isn't much specific
that we can test here.
Co-Authored-By: Philip Chimento <pchimento@igalia.com>
Tests the Intl.DateTimeFormat.prototype.resolvedOptions().calendar value
for each supported calendar.
Co-Authored-By: Philip Chimento <pchimento@igalia.com>