4321 Commits

Author SHA1 Message Date
legendecas
10bfc6c9d2 Revert removal of module flag in ShadowRealm.prototype.importValue tests 2021-12-15 12:33:42 -05:00
legendecas
5074a087e8 fixup! add module flags 2021-12-15 12:32:16 -05:00
legendecas
49b14b577b fixup! 2021-12-15 12:32:16 -05:00
legendecas
2000e858ff Add coverage on ShadowRealm.prototype.importValue onRejected 2021-12-15 12:32:16 -05:00
Joseph Griego
04cd6da021 Add test for shadow realms wrapped function behavior on throw 2021-12-14 14:17:18 -05:00
Philip Chimento
af00d69c39 Some progress on not using time zone names that require Intl
In order to test this functionality on hosts that don't have Intl, we have
to use "UTC" and offset-only time zones here, as the full set of IANA time
zone names are not required to be supported across all hosts.

This makes some progress on https://github.com/tc39/test262/issues/3253
2021-12-14 13:46:13 -05:00
Philip Chimento
e3395bb1e4 Fix some copy-paste errors 2021-12-14 13:46:13 -05:00
Philip Chimento
5e9da36a2f Bring formatting in line with other tests
Other tests similar to these were changed to use a for-of loop, so do the
same here.
2021-12-14 13:46:13 -05:00
Philip Chimento
9c5ec87dba Test ISO strings with multiple fractional second parts
Tests for the normative changes made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1796
2021-12-14 13:39:19 -05:00
Jesse Alama
0b8319355b Test since for PD(T) with largestUnit = year, month
Nails down intended behavior of `PlainDate` and
`PlainDateTime`'s `since` that is already true in the
polyfill but which was specified in a buggy way (and hence
potentially not true in an implementation of Temporal).
Add similar tests for Instant, PlainTime, PlainYearMonth, and
ZonedDateTime.

Reference:
https://github.com/tc39/proposal-temporal/pull/1881
2021-12-14 13:39:19 -05:00
Jesse Alama
85973b35e4 Rendering Duration with negative components
A rendered Duration that was constructed with negative
componented begins with a `-`, but that's the last
time a minus sign appears.
2021-12-14 13:39:19 -05:00
Philip Chimento
8d025ef1d6 Test that non-undefined, non-zoned relativeTo parameters are converted to PlainDate
Tests for the normative changes made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1873

This adds a new Temporal helper calendar that asserts that its dateAdd()
method is always called with a PlainDate instance. This allows testing
that relativeTo parameters are always converted to PlainDate if they are
not ZonedDateTime and not undefined. Prior to the normative PR, they
would be converted to PlainDateTime instead.

Additionally and optionally, the helper calendar can also assert that its
dateAdd() method is called with a specific PlainDate instance. This allows
testing that the instance is the same PlainDate passed as the relativeTo
parameter (in the case of Duration methods) or is the receiver (in the
case of PlainDate methods). For the PlainDateTime and PlainYearMonth
methods the PlainDate instance is synthesized internally so there is no
need to assert that dateAdd() is called with a specific instance.
2021-12-14 13:39:19 -05:00
Philip Chimento
0184842b09 Test rejection of "Z" UTC designators in Plain strings
Tests for the normative changes made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1874
2021-12-14 13:39:19 -05:00
Mike Pennisi
6d5975defc Remove duplicated constructor tests
A number of tests were found to be duplicative based on an analysis of
file contents (included below). Eliminate the duplication by removing
the version of each test with less precise metadata. In cases where this
removal could technically be considered a reduction in coverage,
preserve the verification of additional semantics in the remaining test.

    $ git grep -El 'new\s+\w+.prototype' | sed 's/[^\/]\+$//g' | sort | uniq -c | grep -vE '^\s+1 ' | awk '{print $2}' | xargs grep -Elr 'new\s+\w+.prototype'
    test/built-ins/Array/prototype/join/S15.4.4.5_A6.7.js
    test/built-ins/Array/prototype/join/not-a-constructor.js
    test/built-ins/Array/prototype/pop/not-a-constructor.js
    test/built-ins/Array/prototype/pop/S15.4.4.6_A5.7.js
    test/built-ins/Array/prototype/push/S15.4.4.7_A6.7.js
    test/built-ins/Array/prototype/push/not-a-constructor.js
    test/built-ins/Array/prototype/shift/not-a-constructor.js
    test/built-ins/Array/prototype/shift/S15.4.4.9_A5.7.js
    test/built-ins/Array/prototype/slice/not-a-constructor.js
    test/built-ins/Array/prototype/slice/S15.4.4.10_A5.7.js
    test/built-ins/Array/prototype/sort/not-a-constructor.js
    test/built-ins/Array/prototype/sort/S15.4.4.11_A7.7.js
    test/built-ins/Array/prototype/splice/S15.4.4.12_A5.7.js
    test/built-ins/Array/prototype/splice/not-a-constructor.js
    test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.7.js
    test/built-ins/Array/prototype/toLocaleString/not-a-constructor.js
    test/built-ins/Array/prototype/toString/S15.4.4.2_A4.7.js
    test/built-ins/Array/prototype/toString/not-a-constructor.js
    test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.7.js
    test/built-ins/Array/prototype/unshift/not-a-constructor.js
    test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T1.js
    test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T2.js
    test/built-ins/Function/prototype/apply/not-a-constructor.js
    test/built-ins/Function/prototype/call/not-a-constructor.js
    test/built-ins/Function/prototype/call/S15.3.4.4_A7_T2.js
    test/built-ins/Function/prototype/call/S15.3.4.4_A7_T1.js
    test/built-ins/Function/prototype/toString/S15.3.4.2_A7.js
    test/built-ins/Function/prototype/toString/not-a-constructor.js
    test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A7.js
    test/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js
    test/built-ins/Object/prototype/propertyIsEnumerable/not-a-constructor.js
    test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A7.js
    test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A7.js
    test/built-ins/Object/prototype/toLocaleString/not-a-constructor.js
    test/built-ins/Object/prototype/toString/not-a-constructor.js
    test/built-ins/Object/prototype/toString/not-ctor.js
    test/built-ins/Object/prototype/valueOf/not-a-constructor.js
    test/built-ins/Object/prototype/valueOf/S15.2.4.4_A7.js
2021-12-14 13:38:51 -05:00
Justin Grant
6c2884eb9e Verify that Temporal.*.prototype isn't writeable 2021-12-14 13:38:14 -05:00
Frank Yung-Fong Tang
29a0a1e253 Simplify the testing
The last five lines below are simply WRONG and not according to the spec. 

```
const durationFormat = new Intl.DurationFormat();

verifyNotEnumerable(durationFormat, Symbol.toStringTag);
verifyNotWritable(durationFormat, Symbol.toStringTag);
verifyConfigurable(durationFormat, Symbol.toStringTag);
```
2021-12-14 13:37:35 -05:00
legendecas
6d0a4fdac7 Add assertions of typeerror on ShadowRealm.prototype.importValue 2021-12-14 10:41:09 -05:00
Frank Yung-Fong Tang
b9cac998df Correct set up 2021-12-14 10:39:37 -05:00
Frank Yung-Fong Tang
6fecbe5257 correct test result in NumberFormat/...value-decimal-string.js 2021-12-14 10:39:37 -05:00
Nicolò Ribaudo
2b2d35de69
Delete duplicate "Array#reverse is not a constructor" test (#3342)
It's already tested by test/built-ins/Array/prototype/reverse/not-a-constructor.js
2021-12-10 14:09:36 -05:00
rwaldron
4fa52c8d2d test: expected behavior when bigint and number have "same" value 2021-12-07 16:07:52 -05:00
rwaldron
44b224d388 chore: update esids in test/built-ins/{Map|Set} 2021-12-07 16:07:52 -05:00
rwaldron
d3c5171efd chore: remove duplicate test 2021-12-07 16:07:52 -05:00
rwaldron
3fc472709c fix: Add test about BigInt-Map/Set interaction. Closes gh-3338 2021-12-07 16:07:52 -05:00
rwaldron
a5d8e8e997 test: Add more Array.from tests for array-like. Closes gh-3336 2021-12-07 09:40:23 -05:00
Frank Tang
c2bd148ac7 restore the wrong copy 2021-12-06 09:12:27 -05:00
Frank Tang
970865e44d Rename to returns-string.js 2021-12-06 09:12:27 -05:00
Frank Tang
78907d6393 Move toLocaleString testing to intl402
Move part of the test of toLocaleString which depends on
15 Amendments to the ECMAScript® 2021 Internationalization API Specification
to intl402. Keep behavior specified in earlier chapters in built-ins
2021-12-06 09:12:27 -05:00
Nikhil Singhal
1f16a6ad0e docs: update features 2021-12-03 19:53:31 -05:00
Nikhil Singhal
f00ea58ae9 test(Intl.DurationFormat.prototype): check prototype attributes 2021-12-03 19:53:31 -05:00
jugglinmike
4d23bbf00a
Add tests for "Intl NumberFormat v3" proposal (#3307)
* Add tests for "Intl NumberFormat v3" proposal

This patch is intended to cover only one aspect of the proposal for
ECMA402: the "interpret strings as decimals" feature.

* fixup! Add tests for "Intl NumberFormat v3" proposal
2021-12-03 19:51:57 -05:00
Frank Yung-Fong Tang
46f165ae49 change not-required timezone id to required UTC 2021-12-02 09:46:33 -05:00
Frank Yung-Fong Tang
254c3107ab Replaced not required timezone id w/ required UTC 2021-12-02 09:46:33 -05:00
Frank Yung-Fong Tang
f801aa9468 add back UTC timezone 2021-12-02 09:46:33 -05:00
Frank Yung-Fong Tang
2808c07dc5 Move all tests which have IANA timezone to intl402 2021-12-02 09:46:33 -05:00
Frank Yung-Fong Tang
a3a31f0316 Move test with IATA TimeZone to intl402 2021-12-02 09:46:33 -05:00
Frank Yung-Fong Tang
fdad35e658 Move IATA TimeZone test to intl402 2021-12-02 09:46:33 -05:00
Frank Yung-Fong Tang
00369cfe38 Move test under intl402 2021-12-02 09:46:33 -05:00
Frank Yung-Fong Tang
2576b650af fix the checking 2021-12-02 09:46:33 -05:00
Frank Yung-Fong Tang
ef856ec3b3 Move IANA TimeZone test to intl402 2021-12-02 09:46:33 -05:00
Frank Yung-Fong Tang
0c161cb803 Move IANA TimeZone tests to intl402
IANA TimeZone name other than "UTC" is only required if the implementation " includes the ECMA-402 Internationalization API"
https://tc39.es/proposal-temporal/#sec-isvalidtimezonename
Therefore, we need to split the test and keep this one  without checking "America/Vancouver"
Add a case to test withtout the ":"
2021-12-02 09:46:33 -05:00
Frank Yung-Fong Tang
ef697bbc6d fix en-IN expectation 2021-12-02 09:45:59 -05:00
Frank Yung-Fong Tang
54ef0b1bf4 Fix expectation of "compact" notation 2021-12-02 09:45:59 -05:00
Sarah GHP
4b7f8b49cc Adds invalid constuction options 2021-11-30 15:00:51 -05:00
Sarah GHP
abf437c338 Add test for invalid mixed cal 2021-11-30 15:00:51 -05:00
Sarah GHP
9c6ecf5326 Tests disallowed smallest and largest unit arguments to PYM.since 2021-11-30 15:00:51 -05:00
Sarah GHP
927ad3051f Remove unused includes 2021-11-30 14:59:01 -05:00
Sarah GHP
da9d81a694 Add basic tests converted from demitasse 2021-11-30 14:59:01 -05:00
Mike Pennisi
ae9440df36 fixup! Add tests for "Intl NumberFormat v3" proposal 2021-11-30 14:52:57 -05:00
Mike Pennisi
ef78452924 Add tests for "Intl NumberFormat v3" proposal
This patch is intended to cover only one aspect of the proposal for
ECMA402: the "grouping enum" feature. It also includes coverage for the
formatting option as already defined by the latest version of ECMA402.
2021-11-30 14:52:57 -05:00