Test PlainTime without full ISO strings

Codecov showed that PlainTime strings like "09:00:00Z[UTC]" or
"09:00:00Z" were not being tested. This commit fills that gap.

It'd probably be good to make similar changes for other Plain* types,
but Codecov didn't complain about them so they may be covered
via other tests so it was less urgent.
This commit is contained in:
Justin Grant 2023-07-21 18:04:51 -07:00 committed by Ms2ger
parent e8bbfe704f
commit c84752415d
9 changed files with 18 additions and 0 deletions

View File

@ -10,6 +10,8 @@ features: [Temporal, arrow-function]
const invalidStrings = [
"2019-10-01T09:00:00Z",
"2019-10-01T09:00:00Z[UTC]",
"09:00:00Z[UTC]",
"09:00:00Z",
];
const instance = new Temporal.PlainDate(2000, 5, 2);
invalidStrings.forEach((arg) => {

View File

@ -10,6 +10,8 @@ features: [Temporal, arrow-function]
const invalidStrings = [
"2019-10-01T09:00:00Z",
"2019-10-01T09:00:00Z[UTC]",
"09:00:00Z[UTC]",
"09:00:00Z",
];
const instance = new Temporal.PlainDate(2000, 5, 2);
invalidStrings.forEach((arg) => {

View File

@ -10,6 +10,8 @@ features: [Temporal, arrow-function]
const invalidStrings = [
"2019-10-01T09:00:00Z",
"2019-10-01T09:00:00Z[UTC]",
"09:00:00Z[UTC]",
"09:00:00Z",
];
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
invalidStrings.forEach((arg) => {

View File

@ -10,6 +10,8 @@ features: [Temporal, arrow-function]
const invalidStrings = [
"2019-10-01T09:00:00Z",
"2019-10-01T09:00:00Z[UTC]",
"09:00:00Z[UTC]",
"09:00:00Z",
];
const plainTime = new Temporal.PlainTime();
invalidStrings.forEach((arg) => {

View File

@ -10,6 +10,8 @@ features: [Temporal, arrow-function]
const invalidStrings = [
"2019-10-01T09:00:00Z",
"2019-10-01T09:00:00Z[UTC]",
"09:00:00Z[UTC]",
"09:00:00Z",
];
invalidStrings.forEach((arg) => {
assert.throws(

View File

@ -10,6 +10,8 @@ features: [Temporal, arrow-function]
const invalidStrings = [
"2019-10-01T09:00:00Z",
"2019-10-01T09:00:00Z[UTC]",
"09:00:00Z[UTC]",
"09:00:00Z",
];
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
invalidStrings.forEach((arg) => {

View File

@ -10,6 +10,8 @@ features: [Temporal, arrow-function]
const invalidStrings = [
"2019-10-01T09:00:00Z",
"2019-10-01T09:00:00Z[UTC]",
"09:00:00Z[UTC]",
"09:00:00Z",
];
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
invalidStrings.forEach((arg) => {

View File

@ -10,6 +10,8 @@ features: [Temporal, arrow-function]
const invalidStrings = [
"2019-10-01T09:00:00Z",
"2019-10-01T09:00:00Z[UTC]",
"09:00:00Z[UTC]",
"09:00:00Z",
];
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
invalidStrings.forEach((arg) => {

View File

@ -10,6 +10,8 @@ features: [Temporal, arrow-function]
const invalidStrings = [
"2019-10-01T09:00:00Z",
"2019-10-01T09:00:00Z[UTC]",
"09:00:00Z[UTC]",
"09:00:00Z",
];
const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, "UTC");
invalidStrings.forEach((arg) => {