Commit Graph

6146 Commits

Author SHA1 Message Date
Timothy Flynn e6c6460a5b Update Intl.NumberFormat test with recent reorder of option evaluation
The order of evaluation for "notation" and "roundingIncrement" changed
in https://github.com/tc39/proposal-intl-numberformat-v3/commit/a260aa3.
2022-12-12 12:15:53 +01:00
Justin Grant d8bc356d01 Fix Temporal test failures under Node 19 2022-12-10 11:33:20 -05:00
Richard Gibson 8cd563f978
Intl: Add substantive tests for Array.prototype.toLocaleString (#3741) 2022-12-05 10:51:55 +01:00
Richard Gibson 3d939ef566
Fix typo in CONTRIBUTING.md (#3743) 2022-12-02 13:23:29 -05:00
Richard Gibson 421764fbac
Update test case style to match current patterns (#3742) 2022-12-02 12:53:49 -05:00
Philip Chimento 8f752acdaa Temporal: Test order of property accesses
This contains tests for the normative PR
https://github.com/tc39/proposal-temporal/pull/2437, which is to be
presented for consensus to TC39 in the upcoming plenary meeting. That PR
changes the observable order of property accesses to be alphabetical where
possible.
2022-12-01 11:35:04 -08:00
Timothy Flynn f1fc5c6497 Fix typos in String.prototype.isWellFormed/String.prototype.toWellFormed
1. String.prototype.toWellFormed's name is "toWellFormed".

2. "asserts" does not exist in the test harness, and "assert.throws"
   expects the error type first.
2022-12-01 17:02:41 +01:00
Jordan Harband 30a5b38f23 `String.prototype.isWellFormed`/`String.prototype.toWellFormed`: add tests 2022-12-01 16:04:31 +01:00
Philip Chimento 3ed92d7a33 Bump esvu version
This should bring in the fix that actually lets GraalJS install.
2022-12-01 15:16:40 +01:00
Philip Chimento 7ee321e76a Temporal: Reconcile yearOfWeek tests with changes to YYYY-MM-DD+UU format
This reconciles changes made in two normative PRs to the Temporal proposal
which each had their own separate PRs for tests. The yearOfWeek tests were
written before the changes to the ISO 8601 grammar which disallowed the
YYYY-MM-DD+UU format. This brings the yearOfWeek tests in line with the
tests for the other calendar methods.
2022-12-01 15:07:47 +01:00
Philip Chimento e7895c53d2 Rebuild generated tests
This adds new tests because the tests that previously had name conflicts
are now renamed.
2022-11-30 16:04:02 -08:00
Philip Chimento db39fee915 Fix name conflict in path of decorators test template
This test template shared the same "path" as its sibling,
cls-decl-decorators-valid-syntax.template. That meant that these two
templates would race to generate the same test files with different
contents.

This prefixes the generated tests for class element decorators (as opposed
to class decorators) with "class-element-".
2022-11-30 16:04:02 -08:00
Philip Chimento cc559ac106 Rebuild generated tests 2022-11-30 16:04:02 -08:00
Philip Chimento 1d5e560ca7 Fix typo 2022-11-30 16:04:02 -08:00
Philip Chimento d87a7da6e1 Replace Object.hasOwnProperty.call with Object.prototype.hasOwnProperty.call
While we're at it, use assert() instead of assert.sameValue() for brevity,
if we are not specifically testing that the return value of hasOwnProperty
is the value true or false; and add more informative assertion messages to
help with debugging.

In some cases, the Object.hasOwnProperty.call could be replaced with
verifyProperty(), if the property descriptor was also being verified at
the same time.

This fixes some tests that were faulty to begin with: a common mistake was
Object.hasOwnProperty(obj, prop) which is probably going to return false
when that's not what you want.

The only instances left of `Object.hasOwnProperty` are one regression test
in implementation-contributed which I can't tell if it was intentionally
needed to trigger the regression, and a few instances of
`Object.hasOwnProperty('prototype')` which would defeat the purpose to
convert into `Object.prototype.hasOwnProperty.call(Object, 'prototype')`
form.

Closes: #3524
2022-11-30 16:04:02 -08:00
snek 8609067d0c re-enable graaljs 2022-11-30 10:48:44 -08:00
Philip Chimento 6e4f412d65 Temporal: Tests for normative changes around date-only strings
As per the discussion in
https://github.com/tc39/proposal-temporal/issues/2379#issuecomment-1248557100
and the PR https://github.com/tc39/proposal-temporal/pull/2398, which is
to be presented for consensus to TC39 in the upcoming plenary meeting, UTC
offsets and the Z designator should be disallowed after any date-only
strings (YYYY-MM-DD, YYYY-MM, and MM-DD). They should only be allowed to
follow a time component. Z remains disallowed in any string being parsed
into a Plain type.

Annotations become allowed after any ISO string, even YYYY-MM and MM-DD
where they were previously disallowed.
2022-11-30 10:11:10 -08:00
Philip Chimento 3775b4774b Temporal: Add tests for new yearOfWeek API
To be presented for consensus in the November/December TC39 meeting. This
adds tests for a 'yearOfWeek' getter to PlainDate, PlainDateTime, and
ZonedDateTime, for use alongside 'weekOfYear', and tests for a
corresponding method to Calendar.

The tests are basically the existing tests of 'weekOfYear' adapted.

Temporal issue: https://github.com/tc39/proposal-temporal/issues/2405
2022-11-30 10:06:53 -08:00
Philip Chimento 338063f80f Temporal: Test throwing on time-zone-to-calendar conversion and vice versa
This contains tests for the normative PR
https://github.com/tc39/proposal-temporal/pull/2433, which is to be
presented for consensus to TC39 in the upcoming plenary meeting. That PR
changes ToTemporalCalendar to throw when it encounters a Temporal.TimeZone
instance, and ToTemporalTimeZone to throw when it encounters a
Temporal.Calendar instance.
2022-11-30 10:01:45 -08:00
Philip Chimento 9b5c38d109
Remove Python 2 CI job (#3727)
The Python 2 and 3 jobs run essentially the same thing twice. I asked for
a sign from implementations if any of them were relying on Python 2 for
their test262 runners, but didn't hear of any that were.

The Python tools are changed so rarely that I think it's OK to drop this
CI job. If a future change breaks Python 2 for someone, we can accept PRs
to fix it on a best-effort basis, or reinstate this CI job if it's really
necessary.

Closes: #3480

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2022-11-30 16:43:23 +01:00
Philip Chimento 39302ea3c1 Temporal: Add test for Calendar.id with custom calendar
We already have a similar test covering TimeZone.id that ensures toString
is not called. We did not have this coverage yet for Calendar.id, so adapt
the TimeZone test for Calendar.
2022-11-29 10:57:10 -08:00
Philip Chimento 0fc42035eb Temporal: Update tests to use internal slot in TimeZone and Calendar.id
In https://github.com/tc39/proposal-temporal/pull/2411, to be proposed for
consensus in TC39 in December, the .id getter of TimeZone and Calendar
should no longer call toString().
2022-11-29 10:57:10 -08:00
André Bargull 7988e3eb65 Update expected results for CLDR 42 2022-11-29 11:59:25 +01:00
Philip Chimento 1e9dc7f38e Temporal: Clean up existing uses of foo.splice(0, foo.length)
The second parameter isn't needed if the intention is to empty the array.
Additionally clearing it at the end of the test isn't needed.
2022-11-29 11:53:40 +01:00
Philip Chimento 47b9e32dc3 Temporal: Add some more order-of-operations tests
This adds order-of-operations tests that cover all of the Temporal entry
points that accept options bags, that were not already covered. We'll be
using these tests in the future to verify
https://github.com/tc39/proposal-temporal/issues/2254
However, the tests in this commit reflect the current state of the
proposal, not the potential normative change.
2022-11-29 11:53:40 +01:00
Philip Chimento 5747285940 Temporal: Observe ToString of calendar property in Temporal.PlainTime.from
Similar to the previous commit, but with a toPrimitiveObserver instead of
a calendarObserver, which would cause PlainTime.from() to throw.
2022-11-29 11:53:40 +01:00
Philip Chimento f2e17efaf8 Temporal: Expand order-of-operations tests to cover calendar methods
Some of the existing order-of-operations tests didn't observe the calendar
operations. Add a TemporalHelpers.calendarObserver() calendar to the
invocations of these methods in the order-of-operations tests.
2022-11-29 11:53:40 +01:00
Philip Chimento ed32b59bba Temporal: Expand order-of-operations tests to cover options bags
Some of the existing order-of-operations tests didn't pass an options bag:
primarily from(), with(), add() and subtract(). (since() and until() were
covered in a previous commit.)

Add a TemporalHelpers.propertyBagObserver() options bag to the invocations
of these methods in the order-of-operations tests.
2022-11-29 11:53:40 +01:00
Philip Chimento e1d46f7fdc Temporal helpers: Track daysInMonth() in calendarObserver()
The Temporal.Calendar.prototype.daysInMonth() method is observably called
in a few places in the spec. It should be tracked on the object returned
from TemporalHelpers.calendarObserver().
2022-11-29 11:53:40 +01:00
Philip Chimento 22e01996f3 Temporal: Expand order-of-operations tests to cover different types of relativeTo
The `relativeTo` parameter in an options bag may be undefined, a PlainDate
instance, or a ZonedDateTime instance. Each of these three possibilities
causes a different set of observable operations, which we can test in our
existing order-of-operations tests.
2022-11-29 11:53:40 +01:00
Philip Chimento 1c2508e801 Temporal: Add offset field to order-of-operations tests
There are additional observable operations that occur when providing an
`offset` property in a relativeTo or ZonedDateTime property bag. We can
test these in our existing order-of-operations tests.
2022-11-29 11:53:40 +01:00
Doehyun Baek c8dead8b74 Append newline and use working_directory 2022-11-28 16:37:08 -08:00
Doehyun Baek e303a30f36 Update .github/workflows/esmeta-test262.yml
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2022-11-28 16:37:08 -08:00
Doehyun Baek 8ef0a4c62f CI: Integrate ESMeta 2022-11-28 16:37:08 -08:00
Yusuke Suzuki 83a46bfe0e
test/built-ins/TypedArray/prototype/map/callbackfn-resize.js test result is incorrect (#3721)
%TypedArray%.prototype.map's iteration count does not change even though the source view is resized during the iteration.
And since result is just returning index, then result array should be [0, 1, 2].
2022-11-18 14:17:12 -05:00
Philip Chimento ec752ebaab Temporal: Expand PlainYearMonth and PlainMonthDay strings tests
Use the new collections of strings in TemporalHelpers.ISO to add more
tests for ISO strings in API entry points that convert an ISO string to
Temporal.PlainYearMonth or Temporal.PlainMonthDay.
2022-11-16 16:32:42 -08:00
Philip Chimento 7d0dde3635 Temporal: Remove duplicate number-as-PlainMonthDay test case
Conversion of a Number to an ISO string is already covered in the file
argument-number.js.
2022-11-16 16:32:42 -08:00
Philip Chimento d1b16d7d0e Temporal: Move more collections of valid/invalid strings into TemporalHelpers
The idea is to deduplicate more string tests into methods on this object,
that return collections of valid and invalid strings. This adds
collections of valid and invalid PlainYearMonth and PlainMonthDay strings.
2022-11-16 16:32:42 -08:00
Philip Chimento 10ac2ad03e Fix esids 2022-11-16 16:32:42 -08:00
Ms2ger 60e41ed3cb CI: Disable GraalJS.
Ref. #3703.
2022-11-15 16:48:22 +01:00
Philip Chimento dfb3593e3b Add feature flag for Array.fromAsync
Next proposal that the Igalia team plans to tackle is Array.fromAsync.
This adds the feature flag.
2022-11-15 10:15:25 +01:00
Mathias Bynens 1d5dc6b577 Remove tests involving the `Emoji_Test` property
`Emoji_Test` is not an official Unicode property of strings. Work on standardizing such a property (although likely under a different name) is happening: https://github.com/mathiasbynens/emoji-test-regex-pattern/issues/7
2022-11-10 13:51:56 +01:00
Rick Waldron e04de94c07 Line Terminator test description corrections 2022-11-08 10:37:37 -08:00
Ms2ger 0593463817 Add missed changes for Symbols as WeakMap keys proposal.
Co-authored-by: Rick Waldron <waldron.rick@gmail.com>
2022-11-08 09:44:40 -08:00
Timothy Flynn f6c48f333e Update Intl tests to recognize microsecond and nanosecond as sanctioned
These were added to the list of sanctioned units in a normative change:
https://github.com/tc39/ecma402/commit/f627573
2022-11-04 17:30:26 -07:00
Ms2ger 5d8ebdff05 Improve documentation for assert.compareIterator. 2022-11-04 10:54:28 -07:00
Ms2ger 745f3c01aa Add more tests for duplicated named capture groups.
Fixes #3704.
2022-11-04 10:54:28 -07:00
Ms2ger 54c9ff9084 Rename duplicate-names.js. 2022-11-04 10:54:28 -07:00
Ms2ger c3c6c86663 Fix some esids.
Ref #3705.
2022-11-03 09:20:27 -07:00
Philip Chimento 9e1907e5f7 Unicode case-folding tests
Adds a test similar to the one in #3697, but in the main tree.

The six code points in this test have an "F" for full case mapping in
CaseFolding.txt, and so they should not be considered in the
Canonicalize operation.

Current versions of SpiderMonkey and V8 fail this test, others pass.
2022-11-03 11:50:29 +01:00