Commit Graph

5808 Commits

Author SHA1 Message Date
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
Mike Pennisi 74b12b3777 Improve documentation of harness files & raw flag
Prior to this commit, the term "harness" was used to refer both to the
like-named directory in the repository and the external projects which
consume the tests. Reserve the term "harness" to refer solely to the
files maintained within this project's `harness/` directory, and use
the term "runner" to refer to the external projects.

Prior to this commit, the term "helper" was not defined and therefore
introduced ambiguity in text that described harness files. Replace the
term with more explicit wording in terms of the harness files.

Because test runners have some leeway in how they include harness files,
the requirement that "[t]he test source code must not be modified in any
way" does not necessarily preclude the use of harness files. Update the
instructions for interpreting the `raw` frontmatter flag to explicitly
disallow harness files.
2021-12-03 19:45:24 -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
Ms2ger de8faff7d7 Add some PlainDate#until() tests. 2021-11-30 14:52:26 -05:00
André Bargull 666d62a27f Correct negative-zero sign display tests
The negative sign is computed after rounding, so when the input `-0.0001` is
rounded to `-0`, the expected result should be `"0"` instead of `"-0"`.
2021-11-30 14:51:22 -05:00
Frank Yung-Fong Tang a171df1c03 rollback changes get into the wrong branch 2021-11-30 14:49:23 -05:00
Frank Yung-Fong Tang 4d831016c3 Fix expectation for "Asia/Ulan_Bator" 2021-11-30 14:49:23 -05:00
Frank Yung-Fong Tang 6216034ed7 remove invalid test 2021-11-30 14:49:23 -05:00
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