mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Temporal: Add tests for incorrectly capitalized annotation keys
As per IETF, annotation keys may only consist of lowercase letters, dashes, and digits, and an optional leading underscore. Uppercase letters are non-syntactical. Add tests covering this.
This commit is contained in:
parent
8b781361a9
commit
0c12b84244
@ -2020,6 +2020,9 @@ var TemporalHelpers = {
|
||||
"11-18junk",
|
||||
"11-18[u-ca=gregory]",
|
||||
"11-18[u-ca=hebrew]",
|
||||
"11-18[U-CA=iso8601]",
|
||||
"11-18[u-CA=iso8601]",
|
||||
"11-18[FOO=bar]",
|
||||
];
|
||||
},
|
||||
|
||||
@ -2107,6 +2110,11 @@ var TemporalHelpers = {
|
||||
plainYearMonthStringsInvalid() {
|
||||
return [
|
||||
"2020-13",
|
||||
"1976-11[u-ca=gregory]",
|
||||
"1976-11[u-ca=hebrew]",
|
||||
"1976-11[U-CA=iso8601]",
|
||||
"1976-11[u-CA=iso8601]",
|
||||
"1976-11[FOO=bar]",
|
||||
];
|
||||
},
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.dateadd
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.dateAdd(arg, new Temporal.Duration()),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.dateuntil
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.dateUntil(arg, new Temporal.PlainDate(1977, 11, 19)),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (first argument)`
|
||||
);
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.dateUntil(new Temporal.PlainDate(1977, 11, 19), arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (second argument)`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.day
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.day(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.dayofweek
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.dayOfWeek(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.dayofyear
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.dayOfYear(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.daysinmonth
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.daysInMonth(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.daysinweek
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.daysInWeek(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.daysinyear
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.daysInYear(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.inleapyear
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.inLeapYear(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.month
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.month(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.monthcode
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.monthCode(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.monthsinyear
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.monthsInYear(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.weekofyear
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.weekOfYear(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.year
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.year(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.yearofweek
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.yearOfWeek(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.instant.compare
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const epoch = new Temporal.Instant(0n);
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.Instant.compare(arg, epoch),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (first argument)`
|
||||
);
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.Instant.compare(epoch, arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (second argument)`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.instant.from
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.Instant.from(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.instant.prototype.equals
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Instant(0n);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.equals(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.instant.prototype.since
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Instant(0n);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.since(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.instant.prototype.until
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Instant(0n);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.until(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.compare
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.PlainDate.compare(arg, new Temporal.PlainDate(1976, 11, 18)),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (first argument)`
|
||||
);
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.PlainDate.compare(new Temporal.PlainDate(1976, 11, 18), arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (second argument)`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.from
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.PlainDate.from(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.equals
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainDate(2000, 5, 2);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.equals(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.since
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainDate(2000, 5, 2);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.since(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.toplaindatetime
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"],
|
||||
["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"],
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"],
|
||||
["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"],
|
||||
["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainDate(2000, 5, 2);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.toPlainDateTime(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.tozoneddatetime
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"],
|
||||
["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"],
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"],
|
||||
["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"],
|
||||
["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainDate(2000, 5, 2);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.toZonedDateTime({ plainTime: arg, timeZone: "UTC" }),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.until
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainDate(2000, 5, 2);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.until(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindatetime.compare
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.PlainDateTime.compare(arg, new Temporal.PlainDateTime(1976, 11, 18)),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (first argument)`
|
||||
);
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.PlainDateTime.compare(new Temporal.PlainDateTime(1976, 11, 18), arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (second argument)`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindatetime.from
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.PlainDateTime.from(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindatetime.prototype.equals
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.equals(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindatetime.prototype.since
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.since(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindatetime.prototype.until
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.until(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindatetime.prototype.withplaindate
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.withPlainDate(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindatetime.prototype.withplaintime
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"],
|
||||
["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"],
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"],
|
||||
["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"],
|
||||
["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.withPlainTime(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainmonthday.from
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.PlainMonthDay.from(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainmonthday.prototype.equals
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainMonthDay(5, 2);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.equals(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,33 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaintime.compare
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"],
|
||||
["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"],
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"],
|
||||
["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"],
|
||||
["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.PlainTime.compare(arg, new Temporal.PlainTime(12, 34, 56, 987, 654, 321)),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (first argument)`
|
||||
);
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.PlainTime.compare(new Temporal.PlainTime(12, 34, 56, 987, 654, 321), arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (second argument)`
|
||||
);
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaintime.from
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"],
|
||||
["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"],
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"],
|
||||
["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"],
|
||||
["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.PlainTime.from(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaintime.prototype.equals
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"],
|
||||
["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"],
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"],
|
||||
["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"],
|
||||
["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.equals(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaintime.prototype.since
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"],
|
||||
["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"],
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"],
|
||||
["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"],
|
||||
["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.since(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaintime.prototype.toplaindatetime
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.toPlainDateTime(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaintime.prototype.tozoneddatetime
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.toZonedDateTime({ plainDate: arg, timeZone: "UTC" }),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaintime.prototype.until
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"],
|
||||
["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"],
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"],
|
||||
["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"],
|
||||
["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.until(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.compare
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.PlainYearMonth.compare(arg, new Temporal.PlainYearMonth(2019, 6)),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (first argument)`
|
||||
);
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.PlainYearMonth.compare(new Temporal.PlainYearMonth(2019, 6), arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (second argument)`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.from
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.PlainYearMonth.from(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.equals
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainYearMonth(2000, 5);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.equals(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.since
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainYearMonth(2000, 5);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.since(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.until
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.PlainYearMonth(2000, 5);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.until(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.timezone.prototype.getinstantfor
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.TimeZone("UTC");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.getInstantFor(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.timezone.prototype.getnexttransition
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.TimeZone("UTC");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.getNextTransition(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.timezone.prototype.getoffsetnanosecondsfor
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.TimeZone("UTC");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.getOffsetNanosecondsFor(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.timezone.prototype.getoffsetstringfor
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.TimeZone("UTC");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.getOffsetStringFor(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.timezone.prototype.getplaindatetimefor
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.TimeZone("UTC");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.getPlainDateTimeFor(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.timezone.prototype.getpossibleinstantsfor
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.TimeZone("UTC");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.getPossibleInstantsFor(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.timezone.prototype.getprevioustransition
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.TimeZone("UTC");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.getPreviousTransition(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.zoneddatetime.compare
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const datetime = new Temporal.ZonedDateTime(0n, "UTC");
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[UTC][U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[UTC][u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[UTC][FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.ZonedDateTime.compare(arg, datetime),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (first argument)`
|
||||
);
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.ZonedDateTime.compare(datetime, arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (second argument)`
|
||||
);
|
||||
});
|
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.zoneddatetime.from
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[UTC][U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[UTC][u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[UTC][FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.ZonedDateTime.from(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
for (const offset of ["use", "prefer", "ignore", "reject"]) {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => Temporal.ZonedDateTime.from(arg, { offset }),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr} (offset ${offset})`
|
||||
);
|
||||
}
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.zoneddatetime.prototype.equals
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[UTC][U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[UTC][u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[UTC][FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.ZonedDateTime(0n, "UTC");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.equals(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,23 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.zoneddatetime.prototype.since
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[UTC][U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[UTC][u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[UTC][FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
const instance = new Temporal.ZonedDateTime(0n, timeZone);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.since(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,23 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.zoneddatetime.prototype.until
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01T00:00[UTC][U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01T00:00[UTC][u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01T00:00[UTC][FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
const instance = new Temporal.ZonedDateTime(0n, timeZone);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.until(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,23 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.zoneddatetime.prototype.withplaindate
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
const instance = new Temporal.ZonedDateTime(0n, timeZone);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.withPlainDate(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.zoneddatetime.prototype.withplaintime
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"],
|
||||
["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"],
|
||||
["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"],
|
||||
["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"],
|
||||
["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"],
|
||||
["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"],
|
||||
["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
const instance = new Temporal.ZonedDateTime(0n, timeZone);
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.withPlainTime(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
22
test/intl402/Temporal/Calendar/prototype/era/argument-string-calendar-annotation-invalid-key.js
vendored
Normal file
22
test/intl402/Temporal/Calendar/prototype/era/argument-string-calendar-annotation-invalid-key.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.era
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.era(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.calendar.prototype.erayear
|
||||
description: Annotation keys are lowercase-only
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const invalidStrings = [
|
||||
["1970-01-01[U-CA=iso8601]", "invalid capitalized key"],
|
||||
["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"],
|
||||
["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"],
|
||||
];
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
invalidStrings.forEach(([arg, descr]) => {
|
||||
assert.throws(
|
||||
RangeError,
|
||||
() => instance.eraYear(arg),
|
||||
`annotation keys must be lowercase: ${arg} - ${descr}`
|
||||
);
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user