Commit Graph

230 Commits

Author SHA1 Message Date
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
rwaldron addfd8bf3d fix: ensure that symbol args as message don't break assert.compareArray 2021-10-05 15:16:53 -04:00
Philip Chimento 77a34cf93f Add Temporal tests
This copies over the tests that previously existed in the
tc39/proposal-temporal repository.

For context, see thread starting at:
https://github.com/tc39/test262/issues/3002#issuecomment-926234480

In service of https://github.com/tc39/test262/issues/3002
2021-10-01 14:30:12 -04:00
Rick Waldron b3158bce51
fix: corrections to assert.compareArray and assert.compareArray.format (#3226) 2021-10-01 12:52:15 -04:00
Mike Pennisi d9ddf80479 Revert "Merge pull request #3219 from tc39/rwaldron/migrate-comparearray"
This reverts commit b690cb67be, reversing
changes made to 50dd431dff. This is
necessary because the reverted changeset reduced coverage by an unknown
extent.
2021-10-01 10:18:47 -04:00
rwaldron a81a2a2b1f fix: ensure that assert.compareArray doesn't iterate and evaluate actual and expected more than once, unless absolutely necessary. 2021-09-24 14:26:04 -04:00
rwaldron 1feafce8ce chore: change name of argument 2021-09-24 13:59:02 -04:00
rwaldron 92dad8d640 chore: use [].map.call instead of spread 2021-09-24 13:52:37 -04:00
rwaldron 78554b2dac fix: update assert.compareArray.format to accept "spreadable" 2021-09-24 11:21:44 -04:00
Leo Balter 61bd4e9453 Add identity tests for the assert.throws 2021-09-21 16:45:27 -04:00
André Bargull 71460edfeb Add helper functions to retrieve all calendars, collations, numberingSystems, and simple sanctioned units
And then use these helpers to replace hard-coded lists in other tests.
2021-09-08 09:29:06 -04:00
Rick Waldron 6540b15597
chore: migrate $ERROR -> throw new Test262Error in .jshintrc, harness/sta.js (#3122) 2021-07-29 12:38:45 -07:00
rwaldron 488eb365db chore: migrate $ERROR -> throw new Test262Error in harness/ & test/harness 2021-07-21 15:15:55 -04:00
Frank Yung-Fong Tang bd03c96b60 porting over the Temporal asserts to temporalHelpers.js
Per suggestion by https://github.com/tc39/test262/pull/3049#discussion_r672675461
2021-07-21 09:10:40 -04:00
jugglinmike 162e8be99f
Add tests for Temporal.now.plainDateTime (#3037)
* Temporal.now.plainDateTime: import tests from prop

* Add required metadata

* Correct invalid test

Ensure the error is thrown due to the invocation of the provided method.
Add a separate test to verify how the method is invoked.

* Remove duplicated assertions

* Improve coverage

* Rewrite test to focus on Calendar parameter

The observable interactions with the "timeZone" parameter are verified
by another test which is named for that purpose.

* Remove non-standard test

This test's title suggests that it was intended to verify the behavior
when the "calendar" parameter was undefined. The expected behavior in
that case depends on the presence of a builtin calendar named
"undefined." Test262 cannot definitively assert the presence or absence
of such a calendar.

In contrast to the title, the test body actually uses the calendar name
"japanese."  Test262 cannot definitively assert the presence or absence
of such a calendar.
2021-07-16 09:25:55 -04:00
Paul Bakker a6a895db12
Remove usage of rest and default parameters in harness (#3034)
Also see https://github.com/tc39/test262/issues/3032
2021-07-02 09:04:13 -04:00
Frank Yung-Fong Tang 9997a26c7d
Fix tests on {localeMatcher: "lookup"} (#3008)
* Fix test for only {localeMatcher: "lookup"}

The expectation that "sr-Thai-RS" would be returned is only true with the 
9.2.2 BestAvailableLocale ( availableLocales, locale )
https://tc39.es/ecma402/#sec-bestavailablelocale
algorithm used by 9.2.3 LookupMatcher ( availableLocales, requestedLocales )
https://tc39.es/ecma402/#sec-lookupmatcher

The default for localeMatcher is "best fit" but not "lookup" for all Intl objects.

And for 9.2.4 BestFitMatcher ( availableLocales, requestedLocales )
https://tc39.es/ecma402/#sec-bestfitmatcher
It may not match "sr-Thai-RS" for "sr"  and return ["de", "zh-CN"] instead. Therefore, we need to change this test to only test on {localeMatcher: "lookup"}

* Add option to getLocaleSupportInfo

Needed to test different localeMatcher

* only test for "lookup" localeMatcher

* Get the info based on the localeMatcher

* pass in localeMatcher to getLocaleSupportInfo
2021-06-24 13:37:33 -04:00
Linus Groh 10fc95cacb
Don't use function argument destructuring in regExpUtils.js (#3000)
This increases compatibility with less advanced engines that only have
partial support for recent language features like assignment patterns.
2021-05-28 19:47:36 -04:00
Frank Yung-Fong Tang f9a834c05e Update testIntl.js 2020-12-16 11:59:06 -05:00
Rick Waldron 0e7319c015 atomicsHelper.js: Add $262.agent.setTimeout to defines 2020-10-19 17:48:00 -04:00
Rick Waldron 6d8ab9c35e Coverage: more Atomics.waitAsync tests, fixes, improved messages. 2020-10-08 17:25:45 -04:00
Rick Waldron 04517c7ded Remove erroneous ArrowFunction 2020-10-07 16:43:48 -04:00
Rick Waldron 8aacff591c Standardize built-in constructor testing 2020-10-06 12:01:34 -04:00
Rick Waldron 8250b886b0 Create "Test262Error.thrower" as replacement for "$ERROR". Define $ERROR as Test262Error.thrower 2020-09-16 17:36:54 -04:00
Yusuke Suzuki e8cdf923ef Property clearing code of RegExp constructor is wrong
This code is setting values to $1 etc., which can be non-writable or accessors.
For example, https://github.com/tc39/proposal-regexp-legacy-features/ is specifying them as accessors, and they should throw an error when
it is done in strict code. We should execute `(/(?:)/).test("");` to clear them.
2020-09-02 15:32:18 -04:00
Alexey Shvayka 9e75c60028 Gracefully handle nullish arguments in harness/compareArray 2020-08-31 15:17:24 -04:00
Richard Gibson 24c6732806 Revert "Improve assert.throws output"
This reverts commit 2f9392f288.
2020-08-21 15:58:21 -04:00
Richard Gibson 6207a8058a Improve assert.throws output 2020-08-21 15:58:21 -04:00
Richard Gibson 93ff9b7262 Replace incorrect use of $DONOTEVALUATE 2020-08-21 15:58:21 -04:00
Richard Gibson 46e26a99a6 Add requirement distinguishing $DONOTEVALUATE from Test262Error 2020-08-21 15:58:21 -04:00
Gus Caplan 5f99d05c6a native function validator for your consideration 2020-08-04 19:44:31 -04:00
Gus Caplan 156186aee2 New NativeFunction tests 2020-08-04 19:44:31 -04:00
Leo Balter 5a01caed71 Add feature tag for cleanupSome
The WeakRefs proposal advanced to Stage 4 but cleanupSome moved back to a Stage 2 status.
The tests should remain in Test262 for now but this feature flag should help users to
filter tests out.
2020-07-21 16:57:50 -04:00
Leo Balter 2e127ec40e Rename usage of master to main
Ref #2699
2020-07-15 15:47:15 -04:00
Frank Tang 3c89cde3e0 Intl.DisplayNames make type required
Update the tests to the latest version after we make
the type option now required

Spec:
https://tc39.es/proposal-intl-displaynames/

Changes of spec:
https://github.com/tc39/proposal-intl-displaynames/pull/76
https://github.com/tc39/proposal-intl-displaynames/pull/83
2020-07-10 19:19:34 -07:00
Rick Waldron 529cff8ee6 Atomics: corrections 2020-06-24 12:26:41 -04:00
Rick Waldron 7e603ae236 Atomics: fix mispelled harness function name 2020-06-24 12:26:41 -04:00
Rick Waldron 11a1eabcc6 Atomics.load will operate on TA when TA.buffer is not a SharedArrayBuffer 2020-06-24 12:26:41 -04:00
André Bargull 649d0d2c9a Update list of non-algorithmic numbering systems
Per https://github.com/tc39/ecma402/pull/438
2020-06-24 12:11:36 -04:00
Alexey Shvayka fd90d58f05 Change `alphanum` to character class
Co-Authored-By: Ross Kirsling <rkirsling@gmail.com>
2020-04-29 17:22:05 -04:00
Alexey Shvayka d3b3e5e586 Make `alphanum` a non-capturing group 2020-04-29 17:22:05 -04:00
Alexey Shvayka 4371e3ae36 Remove unnecessary capture group 2020-04-29 17:22:05 -04:00
Alexey Shvayka af05e8e4f7 Revert "Simplify alphanum regex in testIntl.js"
This reverts commit d57bd9d4bd.
2020-04-29 17:22:05 -04:00
Ross Kirsling d57bd9d4bd Simplify alphanum regex in testIntl.js 2020-04-23 10:47:32 -04:00
Rick Waldron 127fa27720 Atomics: remove erroneous argument from getReport() in harness/atomicsHelper.js 2020-04-23 10:32:55 -04:00
Rick Waldron e9ee3dcd62 Atomics: add setTimeout, getReportAsync & safeBroadcastAsync to harness/atomicsHelper .js 2020-04-23 10:32:55 -04:00
André Bargull a52517464f Add Unicode and Transformed extension canonicalisation
Generated using the make_intl_data.py script.
2020-04-09 09:20:55 -04:00
André Bargull 1c93566e66 Update language tag mappings to CLDR 36.1
Generated using the make_intl_data.py script.
2020-04-09 09:20:55 -04:00
André Bargull 756ee6a171 Update list of numbering systems 2020-04-09 09:20:55 -04:00
André Bargull 7556d59fe7 Update list of Intl service constructors
Add RelativeTimeFormat, ListFormat, and DisplayNames to the list of Intl
service constructors.
2020-04-09 09:20:55 -04:00