5830 Commits

Author SHA1 Message Date
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
Ms2ger
0370240141 Port tests for PlainTime. 2022-02-16 09:39:30 -05:00
Jesse Alama
8851f084b6 Use ECMAScript 6 2022-02-11 10:42:35 -05:00
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