Commit Graph

5531 Commits

Author SHA1 Message Date
Frank Yung-Fong Tang 3f5c4fce43 Valid values of 'era' is not defined in Temporal 2021-11-30 14:49:23 -05:00
Philip Chimento 58cffd9f57 Remove intl402/Temporal/TimeZone/from/argument-invalid test
Currently, this test is not conformant to the proposal text.
Temporal.TimeZone.from() calls ToTemporalTimeZone. Since the argument is
a string, we next go to ParseTemporalTimeZone, where on a string such as
`1994-11-05T08:15:30-05:00[UTC]` we would return _result_.[[Name]] (which
would be equal to `UTC`) and discard the UTC offset string.
2021-11-30 14:48:08 -05:00
Philip Chimento 1d09acaac1 Fix not-callable getOffsetNansecondsFor tests
Unfortunately, in #3304 I made a last-minute mistake when I added the
uncallable value to the assertion message, and neglected to test it;
Symbols can't be converted to strings like that, so these tests would
fail. This fixes the assertion messages.
2021-11-30 14:36:59 -05:00
Yusuke Suzuki fc6a9169a4 Update Intl.Locale info API test
weekendStart / weekendEnd are merged into one weekend array.
2021-11-30 14:36:01 -05:00
Yusuke Suzuki c124f6c037 Intl.NumberFormat v3's default roundingMode should be "halfExpand"
The test was using "halfExpand (default)".
2021-11-30 14:35:41 -05:00
arai-a 9f2814f00f
Mention raw flag in test environment section (#3317) 2021-11-19 14:12:59 -05:00
legendecas d52b510a33
Fix unexpected pass on ShadowRealm wrapped function (#3312) 2021-11-17 13:55:09 -08:00
Philip Chimento cba42e88c7 Tests for string shorthand API in round() and total()
Tests for the normative changes made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1875

For convenience, adds some functions to TemporalHelpers to assert that two
Temporal objects are equal, for Duration, Instant, PlainDateTime,
PlainTime, and ZonedDateTime.
2021-11-16 17:06:06 -05:00
Philip Chimento ae53326189 Test TypeError is thrown when getOffsetNanosecondsFor is not callable
Tests for the normative changes made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1829
In a previous version of the specification, there was a fallback to the
intrinsic getOffsetNanosecondsFor when it was undefined.
2021-11-16 17:06:06 -05:00
Sarah GHP 171d4382de Add tests for RangeErrors on fractional inputs to Duration constructor 2021-11-16 17:06:06 -05:00
Mike Pennisi 23a4181a26 Document more test metadata in contribution guide 2021-11-16 17:05:11 -05:00
Mike Pennisi 26f1f4567e Add tests for "Intl NumberFormat v3" proposal
This patch is intended to cover only one aspect of the proposal for
ECMA402: the "negative sign display" feature.
2021-11-09 13:28:42 -05:00
Mike Pennisi eb153de85b Add tests: resizing ArrayBuffer during iteration
The Resizable ArrayBuffer proposal allows implementations to reject any
resize operation, so the tests must accommodate that possibility.

Mitigate the complexity this entails by minimizing branches and by
deferring assertions to locations with shallow call stacks.
2021-11-09 13:27:58 -05:00
jugglinmike 19da3ca075
Add reference for feature flag (#3297) 2021-11-04 12:03:33 -07:00
Rick Waldron b1f3390fe4
Features: remove duplicate "cleanupSome" feature (#2892)
* Features: remove duplicate "cleanupSome" feature

* Replace feature flag in harness file

Co-authored-by: Mike Pennisi <mike@mikepennisi.com>
2021-11-04 13:27:30 -04:00
legendecas 42e21582f8 Add coverage on error throwing of wrapped function created in different realms 2021-11-01 14:10:36 -04:00
legendecas 516623f43a Add coverage on mixing realm shadowrealm prototype calls 2021-11-01 14:08:42 -04:00
Philip Chimento 3dbf940c9b Test removal of sub-minute time zone offsets in ISO strings
Tests for the normative changes made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1871
2021-11-01 14:07:02 -04:00
Philip Chimento 0dec11d949 Test positive and negative offset time zones in FormatTimeZoneOffset
Tests for the normative change made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1833
2021-11-01 14:07:02 -04:00
Philip Chimento 615408bc60 Temporal.ZonedDateTime.p.with() with broken offset property on receiver
Tests for the normative change made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1865
2021-11-01 14:07:02 -04:00
Philip Chimento 4158545044 Temporal.PlainTime property bags
Tests for the normative change to Temporal made in
https://github.com/tc39/proposal-temporal/pull/1862
2021-11-01 14:07:02 -04:00
Mike Pennisi f782971ad2 Remove harness file, arrayContains.js
The `arrayContains` function has a number of deficiencies which make it
inappropriate for Test262:

- It apparently isn't very useful: despite being available for over 7
  years, fewer than ten tests use it
- It's misleading: its documentation reads, "Verify that a subArray is
  contained within an array." In reality, it only verifies that all the
  elements of one array are present in another--order does not matter.
- It's not ergonomic for test authors: it has been misused to create
  tests that were prone to false positives [1]
- It's not ergonomic for implementers: ostensibly designed for use with
  `assert`, the failure messages produced by tests that use it do not
  necessarily have very much context

All code in the "harness" directory adds to the total amount of
project-specific information which contributors are expected to to
learn. In light of the above deficiencies, the burden of this particular
harness file is unjustified.

Remove the harness file and its associated tests. Update the tests which
depend on it to express their expectations using alternate methods, and
strengthen the tests to assert element order wherever appropriate.

[1] https://github.com/tc39/test262/pull/3289
2021-11-01 12:55:10 -04:00
Justin Grant 2c6abf5138 Revert #3250
Fixes #3272 by reverting a change to tests of
`Temporal.PlainDateTime.prototype.since()`.

See tc39/proposal-temporal#1878 for details.
2021-11-01 12:51:28 -04:00
Mike Pennisi 396fc064d8 fixup! Add tests for "Intl NumberFormat v3" proposal 2021-11-01 12:50:38 -04:00
Mike Pennisi c0ea82adf1 fixup! Add tests for "Intl NumberFormat v3" proposal 2021-11-01 12:50:38 -04:00
Mike Pennisi 057c8acec7 Add tests for "Intl NumberFormat v3" proposal
This patch is intended to cover only one aspect of the proposal for
ECMA402: the "rounding mode" feature.
2021-11-01 12:50:38 -04:00
legendecas 37e2c66420 Fix ShadowRealm.prototype.evaluate wraps value in the builtin function realm 2021-10-29 15:34:04 -04:00
Leo Balter 4cb032dc32 Add missing test for SharedArrayBuffer.prototype 2021-10-29 15:21:04 -04:00
Mike Pennisi 7c2af2265c Remove redundancy from test for testTypedArray.js 2021-10-29 15:20:45 -04:00
Mike Pennisi f527a107f2 Relax tests for resolvedOptions property ordering
A number of tests for ECMA402 asserted the exact contents of the array
returned by various `resolvedOptions` methods. This conflicted with the
expectation that more options will be introduced by future editions of
the specification.

Update these tests to assert property order more generically in order to
accommodate implementation of future language proposals and more closely
align with similar tests.

Update all `resolvedOptions` tests to produce more meaningful error
messages (including replacing the generic `arrayContains` assertion with
a specific assertion regarding the value of the first array element).
2021-10-29 15:19:27 -04:00
Mike Pennisi fd8d520cab Correct test for Temporal.Instant#toString
Prior to this patch, the modified test invoked the `arrayContains`
utility function without referencing its return value. Unlike Test262's
assertion functions, `arrayContains` does not throw an error when the
expectation is violated, so the prior usage did not influence test
results.

Additionally, the prior version of this test documented incorrect
expectations regarding the expected value produced by the method under
test. Due to the above, these expectations were not enforced.

Correct the test's expectations and enforce those expectations with a
function that will reliably produce an exception if violated.
2021-10-29 15:15:57 -04:00
Neil Dhar ba82d46238 Add annotations for named capture groups in match indices tests 2021-10-25 09:19:54 -04:00
Mike Pennisi 09485d387f Update tests for DataView & resizable Arraybuffer
This change concerns normative text of the Resizable ArrayBuffer
proposal which is believed to be invalid in its current form; a patch
updating the text is under review [1].

[1] https://github.com/tc39/proposal-resizablearraybuffer/pull/78
2021-10-25 09:17:19 -04:00
legendecas fcaa7594a4 Add WrappedFunction coverage on non-callable proxy 2021-10-22 09:00:50 -04:00
Daniel Nalborczyk 100af9014e generate tests 2021-10-22 09:00:00 -04:00
dnalborczyk 0659f8d952 Update eval-script-code-host-resolves-module-code.case 2021-10-22 09:00:00 -04:00
legendecas ec998749ec Add tests on ShadowRealm WrappedFunction value wrapping 2021-10-21 21:19:31 -04:00
legendecas 541715762c WrappedFunction should accepts callable proxy 2021-10-21 21:15:54 -04:00
Mike Pennisi 1ad9bb7626 Improve errors in NumberFormat#formatToParts tests
Specify a descriptive value for the previously-unused third parameter of
the `verifyFormatParts` function in order to disambiguate error
messages.

This patch was generated with the following command:

    sed -i 's/\(verifyFormatParts([^,]\+, \)\([^,]\+\))/\1\2, "\2")/g' \
      test/intl402/NumberFormat/prototype/formatToParts/signDisplay-currency-*
2021-10-18 09:45:11 -04:00
Mike Pennisi 7ce15a19f3 Correct test descriptions 2021-10-18 09:44:53 -04:00
Rick Waldron 8b4382d2f2
Transform compareArray -> assert.compareArray: test/language/**/*.js (#3239) 2021-10-15 20:35:01 -04:00
Mathias Bynens 5d3eed6433
Add tests for Unicode v14 Identifier{Start,Part} (#3198)
Issue: https://github.com/tc39/ecma262/issues/2514
2021-10-15 20:19:22 -04:00
Phillip Mates d351cfd445
Check the function proto of all wrap points for Shadow Realm (#3269) 2021-10-15 11:05:22 -07:00
Mike Pennisi 8d420cef41 Remove unused functions 2021-10-13 14:18:32 -04:00
Phillip Mates 73cdcfa61e
Fix ShadowRealm globalThis test on filtering logic (#3266)
Ref #3264
2021-10-13 11:04:23 -07:00
Ms2ger 2462d8acd9 Check that PlainMonthDay#toPlainDate() rejects out-of-range dates.
Fixes #3252.
2021-10-12 19:30:45 -04:00
Leo Balter 8ff255a5ec Add tests for ShadowRealm globalThis 2021-10-12 19:30:09 -04:00
legendecas e9cea2125c fixup! 2021-10-12 13:04:09 -04:00
legendecas fc3878f0a4 Add test for ShadowRealm.prototype.evaluate throwing realm check 2021-10-12 13:04:09 -04:00
Rick Waldron fc975b171d
Transform compareArray -> assert.compareArray: test/built-ins/Array/**/*.js (#3238) 2021-10-08 16:16:32 -04:00