5464 Commits

Author SHA1 Message Date
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
Rick Waldron
4ce285da7a
Transform compareArray -> assert.compareArray: test/built-ins/Object/**/*.js (#3236) 2021-10-08 16:13:08 -04:00
legendecas
619afdeab7 Remove unnecessary eval to access realm globals 2021-10-08 14:40:58 -04:00
legendecas
3f6708fa04 Fix ShadowRealm/prototype/importValue/not-constructor.js 2021-10-08 14:40:23 -04:00
Frank Tang
adce88e717 mv tests depend on Intl to intl402. 2021-10-08 14:30:06 -04:00
Ms2ger
64a1628d04 Fix bug in PlainDate#since() test.
Fixes #3249.
2021-10-07 09:08:43 -04:00
Rick Waldron
7be8fca485
fix: re-run clean and build on master to sync generated tests (#3247) 2021-10-06 15:47:46 -04:00
Frank Yung-Fong Tang
61339fd294
Sync test of Temporal.Calendar.p*.fields to 1750 (#3188)
* Sync test  of Temporal.Calendar.p*.fields to 1750

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

* add more test

* add more tests for T*.Calendar.p*.fields

* Update test/built-ins/Temporal/Calendar/prototype/fields/long-input.js

Co-authored-by: Ms2ger <Ms2ger@gmail.com>

* Update test/built-ins/Temporal/Calendar/prototype/fields/long-input.js

Co-authored-by: Ms2ger <Ms2ger@gmail.com>

* Update test/built-ins/Temporal/Calendar/prototype/fields/repeated-throw.js

Co-authored-by: Ms2ger <Ms2ger@gmail.com>

* Update test/built-ins/Temporal/Calendar/prototype/fields/reverse.js

Co-authored-by: Ms2ger <Ms2ger@gmail.com>

* Update test/built-ins/Temporal/Calendar/prototype/fields/reverse.js

Co-authored-by: Ms2ger <Ms2ger@gmail.com>

* Remove loop

* Update test/built-ins/Temporal/Calendar/prototype/fields/long-input.js

Co-authored-by: Ms2ger <Ms2ger@gmail.com>

* Update long-input.js

* Update repeated-throw.js

* Update reverse.js

* ensure the implementation check the content

make sure the validation does not happen after the looping the generator

* add test to check all valid field value

Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2021-10-05 23:03:07 -04:00
Rick Waldron
d5ac0c348a
Transform compareArray -> assert.compareArray: test/intl402/**/*.js (#3240) 2021-10-05 22:54:01 -04:00
Rick Waldron
ed91c59b94
Transform compareArray -> assert.compareArray: test/built-ins/Map/**/*.js (#3237) 2021-10-05 22:46:16 -04:00
Rick Waldron
aea4ae2059
Transform compareArray -> assert.compareArray: test/built-ins/Proxy/**/*.js (#3235) 2021-10-05 22:42:02 -04:00
Rick Waldron
c44eeadcae
Transform compareArray -> assert.compareArray: test/built-ins/RegExp/**/*.js (#3234) 2021-10-05 22:40:39 -04:00
Rick Waldron
0f47fe4528
Transform compareArray -> assert.compareArray: test/built-ins/Reflect/**/*.js (#3232) 2021-10-05 22:33:22 -04:00
Mike Pennisi
891b7915bd Remove superfluous EmptyStatement 2021-10-05 16:28:06 -04:00
Mike Pennisi
8f1fb5c257 Remove unused functions 2021-10-05 16:24:16 -04:00
Mike Pennisi
a6834093aa Improve coverage by invoking functions as intended
Some tests which include function declarations designed to verify
behavior do not reference those functions. Insert the references
necessary for those functions to serve their intended purpose.
2021-10-05 16:22:56 -04:00
rwaldron
addfd8bf3d fix: ensure that symbol args as message don't break assert.compareArray 2021-10-05 15:16:53 -04:00
legendecas
12e9d67bb5 Add tests for cross realms in ShadowRealm.prototype.evaluate 2021-10-04 15:39:12 -04:00