Commit Graph

4321 Commits

Author SHA1 Message Date
Ms2ger df873eed1a Port tests for PlainYearMonth#{add,subtract}. 2022-02-08 15:46:11 -05:00
Alexey Shvayka 5cc9a6bda6 Add Array.prototype.unshift() tests 2022-02-08 15:45:38 -05:00
Alexey Shvayka 37ffcfb7ed Add Array.prototype.shift() tests 2022-02-08 15:45:38 -05:00
Alexey Shvayka 1323cc3152 Add Array.prototype.push() tests 2022-02-08 15:45:38 -05:00
Alexey Shvayka 014ca9fcc3 Add Array.prototype.pop() tests 2022-02-08 15:45:38 -05:00
Ms2ger f98a00bc69 Port tests for PlainYearMonth#{since,until}. 2022-02-08 15:44:41 -05:00
Ms2ger 8848ee91e8 Remove smallestunit-disallowed-units.js.
It is covered by smallestunit-invalid-string.js and largestunit-smallestunit-mismatch.js.
2022-02-08 15:44:41 -05:00
Jesse Alama 525313395b Add tests for with() copying defined properties of source object
https://github.com/tc39/proposal-temporal/issues/1910 found a bug in an
indentation level of a line in the Temporal proposal, which affected the
outcome of the PreparePartialTemporalFields abstract operation. This adds
tests for all entry points that use that abstract operation, to make sure
the behaviour is correct: only defined properties are copied in with()
methods.

This was a normative change that achieved consensus at the December 2021
TC39 meeting.
2022-02-08 15:43:25 -05:00
Philip Chimento 6322630064 Add Duration.toString test for fractionalSecondDigits/smallestUnit
https://github.com/tc39/proposal-temporal/pull/1956 clarified that the
fractionalSecondDigits and smallestUnit options to
Temporal.Duration.p.toString() specified the exact number of digits after
the decimal point, no more and no less.

This was a normative change that achieved consensus at the December 2021
TC39 meeting.
2022-02-08 15:43:25 -05:00
Philip Chimento 8e0c895c4d Test 'T' time designator prefix in PlainTime strings
https://github.com/tc39/proposal-temporal/pull/1952 added support for time
designator prefixes in PlainTime strings. This adds three tests to all
entry points that convert an ISO string to a PlainTime:

- no-implicit-midnight: ISO strings with only a date and no time are no
  longer accepted. Previously they were implicitly interpreted as 00:00.
- with-time-designator: Tests that various forms of string with time
  designator are correctly parsed.
- time-designator-required-for-disambiguation: Tests various cases where
  a string without a time designator is ambiguous and therefore the time
  designator is required, as well as various cases that implementations
  might assume are ambiguous but in fact are not.

This was a normative change that achieved consensus at the December 2021
TC39 meeting.
2022-02-08 15:43:25 -05:00
Philip Chimento 7b45a862b1 Test rounding mode in Duration strings with fractional units
https://github.com/tc39/proposal-temporal/pull/1907 was a bug that caused
negative Duration strings with fractional units to be rounded incorrectly.
Add tests that ensure the rounding mode is correct.

This was a normative change that achieved consensus at the December 2021
TC39 meeting.
2022-02-08 15:43:25 -05:00
Philip Chimento 9af34ce28c Rewrite tests that relied on previous branding behaviour
A follow up to the previous commit, this rewrites some tests that relied
on the lack of brand checks for certain Temporal.TimeZone methods.
https://github.com/tc39/proposal-temporal/pull/1693 added brand checks to
these methods.

We can no longer use a plain object time zone or even a Proxy with a real
branded Temporal.TimeZone object as its handler to do these tests, so we
instead create an instance of Temporal.TimeZone and define own accessor
properties on it in order to test the observable property accesses that we
need to see according to the spec text.

This requires an improvement to TemporalHelpers.observeProperty() in order
to be able to log property accesses to Symbol-valued properties.
2022-02-08 15:43:25 -05:00
Jesse Alama f3c485d6da Ensure branding tests for Temporal.Calendar and TimeZone methods
https://github.com/tc39/proposal-temporal/pull/1693 added checks for the
receiver of certain Temporal.Calendar and Temporal.TimeZone methods. Add
branding tests for these methods, similar to the already existing branding
tests.

This was a normative change that achieved consensus at the December 2021
TC39 meeting.
2022-02-08 15:43:25 -05:00
legendecas 281c781ee4
Fix WrappedFunction throwing tests (#3396)
Also adds more non-string cases for copy name
2022-02-04 15:08:14 -08:00
Linus Groh b3774e9593
Add missing propertyHelper.js include to WrappedFunction tests (#3399) 2022-02-04 15:07:55 -08:00
legendecas d5d9f66a8f Test WrappedFunction properties 2022-02-03 13:53:24 -05:00
Ms2ger d71cf3a339 Reorganize tests for PlainYearMonth#{since,until} largestUnit option. 2022-02-03 12:29:16 -05:00
Philip Chimento 4f20476e0a Add tests for largestUnit/smallestUnit mismatch
These tests already existed for PlainDate. Copy them to the other types
(and use the constructor instead of from() in order to be as simple as
possible)
2022-02-01 18:02:08 -05:00
Philip Chimento 06ced3f812 Add forgotten PlainDate tests
I forgot to add these to PlainDate, testing what happens when we pass
undefined as the value for the largestUnit option. Similar tests already
exist for the other types.
2022-02-01 18:02:08 -05:00
Philip Chimento 4382f17f29 Expand largestUnit and smallestUnit invalid strings tests
Some of these (in PlainDate) had already been rewritten to test more
invalid strings that are otherwise valid units. This commit takes these
improvements and brings them to all of the similar tests for other types'
since() and until() methods.
2022-02-01 18:02:08 -05:00
Jesse Alama 7d82f8ac63 Add tests for invalid extended year "-000000"
https://github.com/tc39/proposal-temporal/issues/1753 records the
consensus reached at the October 2021 TC39 meeting to disallow "-000000"
as an extended year, both in Date.parse and Temporal. This adds tests for
the Temporal part of that.
2022-02-01 17:59:02 -05:00
Philip Chimento 141aca7dba Test offset property in ZonedDateTime property bags
https://github.com/tc39/proposal-temporal/pull/1893 was a bug that caused
the 'offset' property to be ignored in ZonedDateTime property bags. Add
tests that ensure it is not ignored.

This was a normative change that achieved consensus at the October 2021
TC39 meeting.
2022-02-01 17:59:02 -05:00
Jesse Alama 7835f64ae0 Check relativeTo for certain non-zero years, weeks, months, and days
https://github.com/tc39/proposal-temporal/pull/1780 fixed a typo in the
UnbalanceDurationRelative abstract operation, which should affect the
entry points tested here.

This was a normative change that achieved consensus at the October 2021
TC39 meeting.
2022-02-01 17:59:02 -05:00
Ms2ger 331c144f2e Test limits in PlainDate#toPlainYearMonth. 2022-02-01 17:58:30 -05:00
Ms2ger 20329ef359 Test limits in PlainYearMonth.from. 2022-02-01 17:58:30 -05:00
Ms2ger f857cf9968 Test limits in PlainYearMonth constructor. 2022-02-01 17:58:30 -05:00
Ms2ger 516f9a9083 Test PlainYearMonth.prototype.toString. 2022-02-01 17:58:30 -05:00
Ms2ger fddbb4fdf7 Test PlainYearMonth.prototype.toPlainDate. 2022-02-01 17:58:30 -05:00
Ms2ger 51d5cf9a44 Test PlainYearMonth.prototype.valueOf. 2022-02-01 17:58:30 -05:00
Ms2ger ab6fab987e Test PlainYearMonth.prototype.equals. 2022-02-01 17:58:30 -05:00
Ms2ger 405f4fac4b Test PlainYearMonth.compare. 2022-02-01 17:58:30 -05:00
Ms2ger 6ba72412ab Test PlainYearMonth.prototype.with. 2022-02-01 17:58:30 -05:00
Ms2ger 7215b9387f Remove duplicated tests for PlainYearMonth.from overflow.
This is covered in overflow-wrong-type.js.
2022-02-01 17:58:30 -05:00
Ms2ger dff7c70254 Avoid unrelated invalid input in PlainDate.from test. 2022-01-28 13:17:31 -05:00
Ms2ger 158d0bf35f Test PlainYearMonth constructor, from. 2022-01-28 13:17:31 -05:00
Ms2ger 543c8ee938 Pass arguments in PlainYearMonth constructor test.
The arguments are required, so this should make the test more robust.
2022-01-28 13:17:31 -05:00
Romulo Cintra ffae81a3f6 update assert name and length check 2022-01-26 16:32:15 -05:00
Romulo Cintra 034e5dd201 Update test/intl402/DurationFormat/instance/length.js
Thanks

Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2022-01-26 16:32:15 -05:00
Romulo Cintra 95613d4ec8 update DurationFormat tests 2022-01-26 16:32:15 -05:00
Ms2ger d86b913c11 Test Temporal.Now. 2022-01-24 13:36:43 -05:00
Ms2ger 4eb14032ae Basic tests for PlainDate#{add,subtract}. 2022-01-24 13:35:39 -05:00
Ms2ger f768a24ab6 Test singular units in PlainDate#{add,subtract}. 2022-01-24 13:35:39 -05:00
Ms2ger 00b9691218 Test overflow 'constrain' in PlainDate#{add,subtract}. 2022-01-24 13:35:39 -05:00
Ms2ger a042241ed2 Test overflow 'reject' in PlainDate#{add,subtract}. 2022-01-24 13:35:39 -05:00
Ms2ger ef0b1507fc Test balancing in PlainDate#{add,subtract}. 2022-01-24 13:35:39 -05:00
Ms2ger 3fd429b231 Test PlainDate#{add,subtract}. 2022-01-24 13:35:39 -05:00
Ms2ger 3dfc587f36 Test PlainDate#{since,until}. 2022-01-24 13:35:39 -05:00
Ms2ger a46aecc12a Test PlainDate.from with more objects. 2022-01-24 13:35:39 -05:00
Ms2ger 6bf7d8207a Test functions as options in PlainDate.from. 2022-01-24 13:35:39 -05:00
Ms2ger b81ce78746 Test PlainDate.from with a number. 2022-01-24 13:35:39 -05:00