Commit Graph

5225 Commits

Author SHA1 Message Date
Richard Gibson d9a20dfe34 Add a maintenance file for src/insignificant-input-elements 2021-07-16 09:49:17 -04:00
Richard Gibson 3a69fc75d9 Add a test case for each WhiteSpace/LineTerminator character 2021-07-16 09:49:17 -04:00
Richard Gibson 5b1cfdd2b0 Add template for whitespace-after-regular-expression-literal tests 2021-07-16 09:49:17 -04:00
Richard Gibson a7fed497c6 Make it possible to express test case values as a sequence of code points 2021-07-16 09:49:17 -04:00
jugglinmike 8faacdbaee
Add tests: "Extend TimeZoneName Option" proposal (#3042) 2021-07-16 09:45:02 -04:00
Richard Gibson d15066ec39
Cleanup generation code (#3041)
* Simplify find_cases

* Improve help text

* Improve YAML-capturing regex

* Use built-in dedenting

* Fix use of built-in dedenting

* Fix use of built-in dedenting for Python 3
2021-07-16 09:39:57 -04:00
jugglinmike a92327395c
Correct errors in SharedArrayBuffer tests (#3040)
* Correct errors in SharedArrayBuffer tests

* fixup! Correct errors in SharedArrayBuffer tests
2021-07-16 09:31:00 -04:00
Timothy Gu 6319cb1e2a Add more static class property ordering tests
Since https://github.com/tc39/ecma262/pull/1490, the "length" and "name"
properties of a class are defined before any static methods. This is
tested by #2057, in test/language/computed-property-names of all places.

At the same time, static methods with "name" as the name would overwrite
the original property, but retain the original property enumeration
order. This was not previously tested. In fact, the overwriting behavior
was not tested at all for the "length" property.

This commit mends both holes in test coverage.
2021-07-16 09:27:16 -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
jugglinmike afe217b318
Add tests for "Class Static Init. Blocks" proposal (#2968)
* Add tests for "Class Static Init. Blocks" proposal

This proposal is currently at "stage 3" in TC39's standardization
process.

* fixup! Add tests for "Class Static Init. Blocks" proposal

* Correct identifier reference

* Update tests for grammar

* Update tests for identifiers

* Add tests for scope derivation
2021-07-15 08:49:12 -04:00
Frank Yung-Fong Tang f1f3a2d542
Add test for 12.4.21 of Temporal (#3036)
* Add test for 12.4.21 of Temporal

12.4.21 Temporal.Calendar.prototype.fields ( fields )
https://tc39.es/proposal-temporal/#sec-temporal.calendar.prototype.fields

@sffc @Ms2ger @ryzokuken @ljharb

* move to the right file

* remove from wrong place
2021-07-13 19:39:07 -04:00
Nicolò Ribaudo 356afd79a8
Fix syntax in `supportedLocalesOf-unicode-extensions-ignored` test (#3035) 2021-07-12 13:13:56 -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
Kate Miháliková c27f6a5b9a
Add tests for Intl.DateTimeFormat conflicting options (#3033)
Relates to tc39/proposal-temporal#1590
2021-06-30 11:43:26 -04:00
jugglinmike aaf4402b4c
Add tests for Temporal.now.instant (#3031) 2021-06-29 11:45:42 -04:00
jugglinmike ebb6c34fa5
Resizable ArrayBuffer: TypedArray methods (#3027)
* ResizableArrayBuffer: TypedArray.prototype.set

* Resizable ArrayBuffer: TypedArray methods

The files in this patch are highly similar. Only the test for
`TypedArray.prototype.copyWithin` was written manually. The others were
generated from that test via the following script:

    #!/bin/bash

    set -eu

    names_cb='
    every
    filter
    find
    findIndex
    forEach
    map
    reduce
    reduceRight
    some
    '
    names_num='
    at
    fill
    includes
    indexOf
    join
    lastIndexOf
    slice
    '
    names_none='
    entries
    values
    keys
    reverse
    sort
    toLocaleString
    values
    '

    for name in $(printf "${names_cb} ${names_num} ${names_none}"); do
      lower=$(echo ${name} | tr '[:upper:]' '[:lower:]')
      if echo "$names_cb" | grep -xq $name; then
        value='() => {}'
      elif echo "$names_num" | grep -xq $name; then
        value='0'
      else
        value=''
      fi

      if [[ "${name}" == 'at' ]]; then
        features_addition='TypedArray.prototype.at, '
      else
        features_addition=''
      fi

      sed \
        -e "s/copywithin/${lower}/g" \
        -e "s/copyWithin/${name}/g" \
        -e "s/${name}(.*);/${name}(${value});/g" \
        -e "s/resizable-arraybuffer/${features_addition}resizable-arraybuffer/g" \
        ./test/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-this-out-of-bounds.js \
        > ./test/built-ins/TypedArray/prototype/${name}/return-abrupt-from-this-out-of-bounds.js
    done
2021-06-25 15:33:36 -04:00
jmdyck 781f10c9de
Append missing pipe character on "info:" lines (#3030) 2021-06-25 14:50:40 -04:00
Rick Waldron fb0a68a2cf
Add missing features: [resizable-arraybuffer] (#3029)
* Add missing features: [resizable-arraybuffer]

* fixup! Add missing features: [resizable-arraybuffer]

Co-authored-by: Mike Pennisi <mike@mikepennisi.com>
2021-06-25 14:01:23 -04:00
Mike Pennisi 802f22bf0e Temporal.now.timeZone: improve coverage 2021-06-25 13:52:57 -04:00
Mike Pennisi 19c5e38118 Temporal.now.timeZone: import tests from proposal 2021-06-25 13:52:01 -04:00
jugglinmike f734c2d547
Resizable ArrayBuffer: TypedArray accessors (#3028)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: TypedArray accessors
2021-06-25 13:38:51 -04:00
jugglinmike 13d7b79e90
Resizable ArrayBuffer: TypedArray constructor (#3026)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: TypedArray constructor
2021-06-25 13:31:05 -04:00
jugglinmike 884ed7f6f8
Resizable ArrayBuffer: SharedArrayBuffer accessors (#3025)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: SharedArrayBuffer accessors

* fixup! Resizable ArrayBuffer: SharedArrayBuffer accessors
2021-06-25 13:30:30 -04:00
jugglinmike a82aeaa391
Resizable ArrayBuffer: SharedArrayBuffer methods (#3024)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: SharedArrayBuffer methods

* fixup! Resizable ArrayBuffer: SharedArrayBuffer methods
2021-06-25 13:29:29 -04:00
jugglinmike 1db1bb8216
Resizable ArrayBuffer: SharedArrayBuffer ctor (#3023)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: SharedArrayBuffer ctor
2021-06-25 13:27:36 -04:00
jugglinmike a7fb08e3d7
Resizable ArrayBuffer: DataView accessors (#3022)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: DataView accessors
2021-06-25 13:26:32 -04:00
jugglinmike 5b31a8a9ba
Resizable ArrayBuffer: DataView methods (#3021)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: DataView methods

The files in this patch are highly similar. Only the test for
`DataView.prototype.getBigInt64` and `DataView.prototype.setBigInt64`
were written manually. The others were generated from those files via
the following script:

    #!/bin/bash

    set -eu

    names='
    BigUint64
    Float32
    Float64
    Int16
    Int32
    Int8
    Uint16
    Uint32
    Uint8
    '

    for name in ${names}; do
      lower=$(echo ${name} | tr '[:upper:]' '[:lower:]')
      if [ ${name} == 'BigUint64' ]; then
        replace_bigints=''
      else
        replace_bigints='-e s/\b\([0-9]\+\)n\b/\1/g'
      fi

      sed \
        -e "s/getbigint64/get${lower}/g" \
        -e "s/getBigInt64/get${name}/g" \
        ${replace_bigints} \
        ./test/built-ins/DataView/prototype/getBigInt64/resizable-buffer.js \
        > ./test/built-ins/DataView/prototype/get${name}/resizable-buffer.js

      sed \
        -e "s/setbigint64/set${lower}/g" \
        -e "s/setBigInt64/set${name}/g" \
        ${replace_bigints} \
        ./test/built-ins/DataView/prototype/setBigInt64/resizable-buffer.js \
        > ./test/built-ins/DataView/prototype/set${name}/resizable-buffer.js
    done
2021-06-25 13:24:00 -04:00
jugglinmike 4da5c800a3
Resizable ArrayBuffer: ArrayBuffer accessors (#3020)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: ArrayBuffer accessors

* fixup! Resizable ArrayBuffer: ArrayBuffer accessors
2021-06-25 13:21:11 -04:00
jugglinmike 93ad86b859
Resizable ArrayBuffer: ArrayBuffer methods (#3019)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: ArrayBuffer methods

* fixup! Resizable ArrayBuffer: ArrayBuffer methods
2021-06-25 13:19:33 -04:00
jugglinmike b3c2d3a88e
Resizable ArrayBuffer: ArrayBuffer constructor (#3018)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: ArrayBuffer constructor
2021-06-25 13:18:42 -04:00
Dan Clark 966c76617e
Add 'import-assertions' feature tag to json modules tests (#3016)
* Add 'import-assertions' feature tag to json modules tests

* Add a couple of others that I missed
2021-06-24 14:13:45 -04:00
Frank Yung-Fong Tang c8d75c3681
Add feature values for ECMA402 Stage 3 proposals (#3012) 2021-06-24 13:50:00 -04:00
jugglinmike 6c9d2222fb
lint: disallow duplicate values in "features" tag (#3010) 2021-06-24 13:38:18 -04:00
jugglinmike 64a8968246
lint: disallow extra fields in "negative" metadata (#3009) 2021-06-24 13:37:55 -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
Ujjwal Sharma 26cf753e74
intl402: add output tests for locale-info (#3007)
* intl402: locale-info tests for array output

* fixup! intl402: locale-info tests for array output

* fixup! intl402: locale-info tests for array output
2021-06-24 13:20:47 -04:00
Mike Pennisi 9b4ca4371b Add tests for change in Reference Records
These tests support the following normative change

"Normative: Allow null or undefined in Reference Records"
https://github.com/tc39/ecma262/pull/2267

The tests concerning the `delete` operator increase coverage to verify
behavior which, though related, is not altered by the normative change.
These tests are intended to guard against regressions as engines
implement the new semantics.
2021-06-24 13:16:43 -04:00
Mike Pennisi 93541f09e2 Test sequence during deletion of SuperProperty 2021-06-24 13:15:34 -04:00
Jamie Kyle bad7c0487e
Add tests for Object.hasOwn (#2995)
* Add tests for Object.hasOwn

* Update test/built-ins/Object/hasOwn/length.js

Co-authored-by: Jordan Harband <ljharb@gmail.com>

* Update test/built-ins/Object/hasOwn/name.js

Co-authored-by: Jordan Harband <ljharb@gmail.com>

* Fixup comments for Object.hasOwn

* Add Object.hasOwn descriptor test

* use assert.sameValue with true instead of assert()

* remove extra semicolons

* Remove old $ERROR style tests from hasown

* Fix thrown error type in hasown tests

* Fix incorrect test cases

Co-authored-by: Jordan Harband <ljharb@gmail.com>
2021-06-16 17:35:06 -04:00
Michael Dyck 1b16396c88 Delete duplicate feature-declaration 2021-06-10 12:03:05 -04:00
Michael Dyck 52e7bfc4b6 "flags" is a top-level key, not a key within "negative" 2021-06-10 12:03:05 -04:00
Michael Dyck 675cad4aa3 Remove leading spaces from "---*/" line 2021-06-10 12:03:05 -04:00
Kartik Kapoor 21f07ead19
Update CONTRIBUTING.md (#3005) 2021-06-10 11:36:04 -04:00
Aaryan Porwal 20a089566e
Update CONTRIBUTING.md (#3004)
Fixed some grammatical issues in the document.
2021-06-10 11:34:28 -04:00
Mike Pennisi e793512b55 Add tests for the "JSON modules" language proposal
https://github.com/tc39/proposal-json-modules

This proposal advanced to Stage 3 of TC39's standardization process on
2021-01-27.
2021-05-28 20:02:59 -04:00
Mike Pennisi 56ca8add7d Update project structure to support non-JS files
This change is in service of forthcoming tests for the "JSON modules"
language proposal [1]. Verifying the semantics of that proposal requires
modules whose source text is not valid ECMAScript; this change updates
the guidelines for contributing and interpreting tests so that such test
material can be handled consistently.

Differentiating JSON files with a distinct file name suffice will assist
consumers which require special handling of such files (e.g. web
browsers).

Change the pattern used to designate "fixture" files so that it may be
applied to files used for JSON modules.

Increment the project version number to alert consumers of this change
in interpreting instructions.

[1] https://github.com/tc39/proposal-json-modules
2021-05-28 20:02:59 -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
Mike Pennisi 1ebd34b53b CI: Do not report test failures as errors
Prior to this patch, the CircleCI continuous integration environment was
configured to report test failures in a negative light, displaying red
cross-marks and reporting that "some checks were not successful" in
commits and GitHub Pull Requests which included them.

The passing/failing status of tests does not influence their
desirability for Test262. (In practice, engines very commonly fail
newly-contributed tests.)

Although these conflicting interpretations does not technically
interfere with the maintainers' ability to merge new contributions, it
does create confusion for many contributors who interpreted the UI as a
rejection of their work.

In addition, this behavior made it impossible to distinguish between the
benign test failures and disruptive infrastructural problems (e.g. the
crashing of engines).

Reconfigure the continuous integration environment to accept passing and
failing tests equally, and to only report a problem when the Test262
project's testing infrastructure behaves unexpectedly.
2021-05-28 18:06:58 -04:00
Mike Pennisi d454b8389b Move some AnnexB tests per proposed spec change
Additionally, update test metadata and introduce two new tests to
complete coverage.

Reference: "Normative: Make B.1.{1,2} normative"
https://github.com/tc39/ecma262/pull/1867
2021-05-21 13:06:41 -04:00
Ujjwal Sharma 5e0fc43c66
Add basic tests for proposal-intl-locale-info (#2987)
* Add basic tests for weekInfo

* Add basic tests for textInfo

* Add basic tests for timeZones

* Add basic tests for numberingSystems

* Add basic tests for hourCycles

* Add basic tests for collations

* Add basic tests for calendars

* Add feature for Intl.Locale-info

* add validation to branding tests for locale-info

Add additional assertion to branding tests for proposal-intl-locale-info
to make sure they don't pass spuriously when the proposal is not
implemented.
2021-05-18 22:40:08 -04:00