Commit Graph

83 Commits

Author SHA1 Message Date
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 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
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
Ms2ger de8faff7d7 Add some PlainDate#until() tests. 2021-11-30 14:52:26 -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
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
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 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
Ms2ger 2462d8acd9 Check that PlainMonthDay#toPlainDate() rejects out-of-range dates.
Fixes #3252.
2021-10-12 19:30:45 -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
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
Philip Chimento 56e537b916 Consolidate duplicate tests
There were a few tests already in the tree that overlapped ones that I
added in the previous commit. I've consolidated these and taken
information from the deleted ones where applicable, and improved on the
autogenerated assertion messages.
2021-10-01 14:30:12 -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
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
Philip Chimento c7ca06acb2
Remove duplicate tests (#3222)
While working on adding the Temporal tests from tc39/proposal-temporal I
noticed that these tests tested the same thing as each of the branding.js
tests in the same directory. This removes the duplicate tests.
2021-09-30 20:17:12 -04:00
rwaldron 4847d9db5a chore: update test/**/*.js to use assert.compareArray wherever applicable 2021-09-24 12:58:15 -04:00
Frank Yung-Fong Tang 16dae73171
improve the case with the version without : (#3204) 2021-09-17 14:02:37 -04:00
Mike Pennisi aa5c2adb7c Improve coverage: zonedDateTime & zonedDateTimeISO 2021-09-13 10:09:42 -04:00
Mike Pennisi 424406b5be Correct metadata 2021-09-13 10:09:42 -04:00
Mike Pennisi 57491d838f Import tests for Temporal.Now.zonedDateTimeISO
These tests originated in the Temporal proposal repository
https://github.com/tc39/proposal-temporal
2021-09-13 10:09:41 -04:00
Mike Pennisi c99ec1780d Import tests for Temporal.Now.zonedDateTime
These tests originated in the Temporal proposal repository
https://github.com/tc39/proposal-temporal
2021-09-13 10:09:41 -04:00
Mike Pennisi 0232d97415 Add tests for Temporal.Now.plainDateTimeISO 2021-09-13 10:09:41 -04:00
André Bargull 0181293d38 "era" and "eraYear" are ECMA-402 only properties.
Both properties are only present when ECMA-402 is supported.
2021-09-02 11:23:23 -07:00
Mike Pennisi 0ecc26b987 Fix error in test for Temporal.now.plainDateTime 2021-09-02 10:03:02 -04:00
Michael Dyck 9cb0746f52 Normalize some YAML
In some recently added tests, the `description` is a multi-line scalar
in flow notation. Change it to block notation.
2021-09-02 10:00:32 -04:00
Philip Chimento 45a913c057
Add branding tests from Temporal (#3138)
Closes: #3137

Co-authored-by: Ms2ger <Ms2ger@igalia.com>
2021-08-11 12:31:23 -07:00
Rick Waldron bb93efdb6b
Automated assertion message update (#3136)
This also required manually fixing the "actual" and "expected" order of many assert.sameValue(...) calls.
2021-08-10 10:40:04 -07:00
Frank Tang 86e23998e3 Add more tests 2021-08-06 18:31:47 -04:00
Frank Tang 88d1ede7d6 Split the test and add more tests 2021-08-06 18:31:47 -04:00
Frank Tang bb4729126c Remove incorrect lines 2021-08-06 18:31:47 -04:00
Frank Tang ee94a2ce7f fix directory name 2021-08-06 18:31:47 -04:00
Frank Tang 35850e5782 Add Temporal.Calendar.prototype.daysIn* tests. 2021-08-06 18:31:47 -04:00
Rick Waldron e6c21464f5 Automated feature flag update 2021-08-05 18:44:17 -04:00
Frank Tang 1c722a8158 fix comments 2021-08-05 18:31:44 -04:00