Commit Graph

5740 Commits

Author SHA1 Message Date
Philip Chimento 16ad841e7e Fix arithmetic in TemporalHelpers.oneShiftTimeZone
I made a mistake with one of the signs in one of the time zones that we
use for verifying DST handling. Luckily this didn't affect any previously
existing tests, but it affected some new tests that I'm going to add in
the next commit.

How do I know that _this_ arithmetic is correct? I feel reasonably
confident with the added test.
2022-04-04 16:24:17 -04:00
Mike Pennisi 276e79d62e Deprecate some property helpers
Document the preference for `verifyProperty` over the various other
property-related helper functions.
2022-04-04 11:28:37 -04:00
jugglinmike 5eb7dfbced
Remove configuration file for third-party tool (#3450)
The `.jshintrc` file configures the JavaScript "linting" tool named
JSHint. Test262 does not depend on that tool, making the file's purpose
and validity ambiguous and potentially distracting.
2022-04-04 11:27:22 -04:00
Romulo Cintra 926b0960d7
update nfv3 test for roundingIncrement (#3441) 2022-03-31 14:53:20 -07:00
Jesse Alama 4c7c24646a
Check a variety of offset Etc/GMT timezones (#3403)
Tests for normative change https://github.com/tc39/proposal-temporal/pull/2050
2022-03-30 08:33:52 -07:00
Jesse Alama fe40aea50c Emit fallback day 1 2022-03-29 16:58:36 -07:00
Jesse Alama 9aaa22cb06 Ensure fallback years values are present 2022-03-29 16:58:36 -07:00
Jesse Alama ee1f96235b Ensure reference data is emitted when calendarName = 'always'
References:

+ https://github.com/tc39/proposal-temporal/issues/1971
2022-03-29 16:58:36 -07:00
Jesse Alama 76b0bafba6 Update test/built-ins/Temporal/Duration/compare/twenty-five-hour-day.js
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2022-03-29 16:50:41 -07:00
Jesse Alama 2aa754b7cf Add test for DST balancing
References:

+ https://github.com/tc39/proposal-temporal/issues/1791

Thanks @ptomato for the suggestion to use
`springForwardFallBackTimeZone`.
2022-03-29 16:50:41 -07:00
Richard Gibson 3ab8adc237 Require String.prototype.localeCompare to check for canonical equivalence 2022-03-29 16:43:22 -04:00
Philip Chimento 3eea1a7959 Add tests for various invalid ISO strings for PlainDate
These tests check API entry points that convert strings to
Temporal.PlainDate, with a list of various strings that are all not valid
for that context according to ISO 8601.
2022-03-29 11:26:53 -04:00
Philip Chimento ad74a4ebba Rename some "argument-string" tests to be more specific
I'd like to add basic functionality tests for string arguments, and these
tests are testing something more specific: that a Get of the "overflow"
property on the passed-in options object is observable. Rename
accordingly.
2022-03-29 11:26:53 -04:00
Frank Tang 52af2b6763 Add tests for Temporal.Calendar.p*.yearMonthFromFields
(Philip, March 2022: This was originally Frank's PR #3061. I did some
reformatting, removed duplicate tests, and combined with some existing
tests.)
2022-03-29 11:23:43 -04:00
Frank Tang 0bad719e79 Add test for Temporal.Duration.p*.abs
(Philip, March 2022: This was originally Frank's PR #3062. I did some
reformatting and removed duplicate tests)
2022-03-29 11:23:43 -04:00
Frank Tang f23602f6ce Add test for Temporal.Duration.p*.negated
(Philip, March 2022: This was originally Frank's PR #3063. I did some
reformatting and removed duplicate tests)
2022-03-29 11:23:43 -04:00
Frank Tang b8af7ff369 Add test for Temporal.Duration.p*.toJSON
(Philip, March 2022: This was originally Frank's PR #3064. I did some
reformatting and removed duplicate tests)
2022-03-29 11:23:43 -04:00
Frank Tang 2c8b69f8d0 Add tests for Temporal.Duration.p*.with
(Philip, March 2022: This was originally Frank's PR #3065. I did some
reformatting, removed duplicate tests, and combined with some existing
tests.)
2022-03-29 11:23:43 -04:00
Iban Eguia Moraza f59bafaa20 Fixed YAML in some new test metadata 2022-03-28 12:49:32 -07:00
Jesse Alama 99b2a70789
Use ECMAScript version 11 (#3448)
We use BigInt syntax in a bunch of tests. This change
registers that fact with linters that use `.jshintrc`.
2022-03-25 20:13:17 -04:00
Ms2ger f964584508 Expand overflow-invalid-string.js tests. 2022-03-25 11:18:13 -07:00
Jesse Alama 7b78d4be74
Port some basic Temporal.PlainDateTime tests from Demitasse to test262 (#3430)
* Create a Temporal.PlainDateTime with all arguments supplied.

Migrates some tests that currently exist in the
proposal-temporal repo.

* Check all data in Temporal.PlainDateTimes, variously constructed

Enrich existing tests to check all basic data in the
instance of `Temporal.PlainDateTime`, not just a single
field.

These additional checks were motivated by the migration of
existing Demitasse tests in the proposal-temporal repo to
test262. The Demitasse tests check more than a single
field.
2022-03-21 12:16:18 -07:00
legendecas f71d5e29cb Add test for throwing WrappedFunctionCreate 2022-03-17 13:59:03 -04:00
Romulo Cintra 81895b1543 use all values max and min fraction and significant digits 2022-03-14 16:52:38 -07:00
Frank Tang 7d5b0ec6f4 Add test for Temporal.Instant.p*.add
This was originally Frank's PR #3075. I rebased it, added assertion
messages, did some reformatting, and combined with some existing tests.
2022-03-14 13:52:04 -04:00
Frank Tang 11c2559651 Add tests for Temporal.Instant.p*.subtract
(Philip, March 2022: I rebased Frank's original PR #3076, did some
reformatting, removed duplicate tests, and combined with some existing
tests.)
2022-03-14 13:52:04 -04:00
Philip Chimento 0bccacda69
Merge pull request #3429 from Igalia/roundingmode-invalid-string
Test more invalid values for roundingMode.
2022-03-11 16:01:53 -08:00
Ms2ger 104e5e8fab Test more invalid values for roundingMode. 2022-03-11 09:51:57 +01:00
Ms2ger 51ce1fa00f Expand some Duration#toString() tests. 2022-03-10 17:05:49 -05:00
Ms2ger c6c31c8dac Add and expand tests for Duration constructor / from(). 2022-03-10 17:05:49 -05:00
Ms2ger d45476b9fd Add a test for observable calls in Temporal.Duration constructor. 2022-03-10 17:05:49 -05:00
legendecas 50dc96e59e Split Array.prototype.Symbol.unscopables tests for features 2022-03-10 17:04:16 -05:00
legendecas d8fb00d741 Add missing feature flag array-grouping 2022-03-10 17:04:16 -05:00
Frank Yung-Fong Tang 5fb0f5b6d2 Remove SPACES before features 2022-03-09 15:24:33 -05:00
Frank Yung-Fong Tang bc4af482b0 Fix features by removing leading space 2022-03-09 15:24:33 -05:00
Philip Chimento f7fb969cc4 Add tests for T time designator prefix not allowing space
Here's a test I should have included in #3395. It's allowed to replace the
"T" in the middle of an ISO string with a space, but not when the "T" is a
time designator prefix. This assertion ensures that implementations make
this distinction correctly.
2022-02-28 14:41:18 -05:00
Jesse Alama 131c396b6a Remove number test (yields a different error, not an exception) 2022-02-28 14:37:03 -05:00
Jesse Alama 8ff1e510b9 Add a couple more types 2022-02-28 14:37:03 -05:00
Jesse Alama 9c6e3aff38 Move to more sensible location 2022-02-28 14:37:03 -05:00
Jesse Alama 10f9a69295 Move test to a more sensible location
Also, use a more sensible ID as well. Add another test (for
Date values).
2022-02-28 14:37:03 -05:00
Jesse Alama ecd24faa82 Fix buggy error message 2022-02-28 14:37:03 -05:00
Jesse Alama 918cefcd09 Check `formatRange` on many pairs of invalid arguments 2022-02-28 14:37:03 -05:00
Ms2ger 2f592de0aa Port tests for PlainTime. 2022-02-28 14:32:34 -05:00
Ms2ger 18ce639a4c Port tests for PlainTime. 2022-02-21 16:02:05 -05:00
Ms2ger 1fe9bd3951 Add a basic test for PlainDateTime#toPlainTime. 2022-02-21 16:02:05 -05:00
Philip Chimento 615a2eb9a1 Fix tests for private reference with logical assignment
There were three things wrong with the 'and', 'or', and 'nullish' tests
that I added as part of #2940:

1. They were in the wrong folder (should be
   expressions/logical-assignment, not expressions/compound-assignment)
2. The tests for ||= and ??= on readonly accessor properties were
   incorrect. These assignments would short-circuit if the getter
   returned 1 as it previously did, so PutValue would not throw.
3. The tests for ||= and ??= on private methods were invalid, as a
   method always evaluates to true in a boolean context, and is not
   nullish, so these would always short-circuit.

I've removed the invalid private method cases, fixed the readonly
accessor cases, and added new templates to test the short-circuit
behaviour as well as the non-short-circuit behaviour.

Closes: #3413
2022-02-21 15:38:59 -05:00
legendecas ec39db5877 Test array grouping Symbol.unscopables values 2022-02-16 09:57:44 -05:00
Philip Chimento 1b1097dbf6 Add tests for compound assignment to private reference
This tests compound assignment, with each compound assignment operator,
to each kind of private reference (private field, private accessor
property with getter and setter, private accessor property with only
getter, and private method). The latter two cannot be assigned to and
therefore throw.

Closes: #2940
2022-02-16 09:56:59 -05:00
Philip Chimento 0b0fbdb04b Fix path example in generated test instructions
We should not have an absolute path (starting with a slash) in this
field, because that will mess up the test generation program.
2022-02-16 09:56:59 -05:00
Philip Chimento 08937278f1 Add .case and .template files to .editorconfig
Without this, my editor thinks they should be 4-space tabbed files, but
they should be treated the same as other files containing JavaScript.
2022-02-16 09:56:59 -05:00