mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Temporal: Add tests for unknown annotation without critical flag
See https://github.com/tc39/proposal-temporal/pull/2397 Adds tests for ISO strings with unrecognized annotations, (i.e., neither time zone nor calendar), in various combinations with recognized annotations.
This commit is contained in:
parent
9d87845bb0
commit
dc11e501d6
30
test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-string-unknown-annotation.js
vendored
Normal file
30
test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.dateAdd(arg, new Temporal.Duration());
|
||||
|
||||
TemporalHelpers.assertPlainDate(
|
||||
result,
|
||||
2000, 5, "M05", 2,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
30
test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-string-unknown-annotation.js
vendored
Normal file
30
test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.dateUntil(arg, arg);
|
||||
|
||||
TemporalHelpers.assertDuration(
|
||||
result,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/Calendar/prototype/day/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/Calendar/prototype/day/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.day(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
2,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.dayOfWeek(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
2,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.dayOfYear(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
123,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.daysInMonth(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
31,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.daysInWeek(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
7,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.daysInYear(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
366,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.inLeapYear(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
true,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/Calendar/prototype/month/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/Calendar/prototype/month/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.month(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
5,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/Calendar/prototype/monthCode/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/Calendar/prototype/monthCode/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.monthCode(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
"M05",
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.monthsInYear(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
12,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.weekOfYear(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
18,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/Calendar/prototype/year/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/Calendar/prototype/year/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.year(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
2000,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,26 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00Z[foo=bar]", "alone"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00Z[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1970-01-01T00:00Z[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = Temporal.Instant.compare(arg, arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,26 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00Z[foo=bar]", "alone"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00Z[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1970-01-01T00:00Z[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = Temporal.Instant.from(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result.epochNanoseconds,
|
||||
0n,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
28
test/built-ins/Temporal/Instant/prototype/equals/argument-string-unknown-annotation.js
vendored
Normal file
28
test/built-ins/Temporal/Instant/prototype/equals/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00Z[foo=bar]", "alone"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00Z[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1970-01-01T00:00Z[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Instant(0n);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.equals(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
true,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/Instant/prototype/since/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/Instant/prototype/since/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00Z[foo=bar]", "alone"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00Z[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1970-01-01T00:00Z[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Instant(0n);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.since(arg);
|
||||
|
||||
TemporalHelpers.assertDuration(
|
||||
result,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/Instant/prototype/until/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/Instant/prototype/until/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00Z[foo=bar]", "alone"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00Z[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1970-01-01T00:00Z[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Instant(0n);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.until(arg);
|
||||
|
||||
TemporalHelpers.assertDuration(
|
||||
result,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = Temporal.PlainDate.compare(arg, arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = Temporal.PlainDate.from(arg);
|
||||
|
||||
TemporalHelpers.assertPlainDate(
|
||||
result,
|
||||
2000, 5, "M05", 2,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/PlainDate/prototype/equals/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/PlainDate/prototype/equals/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainDate(2000, 5, 2);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.equals(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
true,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
30
test/built-ins/Temporal/PlainDate/prototype/since/argument-string-unknown-annotation.js
vendored
Normal file
30
test/built-ins/Temporal/PlainDate/prototype/since/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainDate(2000, 5, 2);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.since(arg);
|
||||
|
||||
TemporalHelpers.assertDuration(
|
||||
result,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,37 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["12:34:56.987654321[foo=bar]", "alone"],
|
||||
["12:34:56.987654321[UTC][foo=bar]", "with time zone"],
|
||||
["12:34:56.987654321[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["T12:34:56.987654321[foo=bar]", "with T"],
|
||||
["T12:34:56.987654321[UTC][foo=bar]", "with T and time zone"],
|
||||
["T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with T and calendar"],
|
||||
["T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with T, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar]", "with date"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar]", "with date and time zone"],
|
||||
["1970-01-01T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with date and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with date, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainDate(2000, 5, 2);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.toPlainDateTime(arg);
|
||||
|
||||
TemporalHelpers.assertPlainDateTime(
|
||||
result,
|
||||
2000, 5, "M05", 2, 12, 34, 56, 987, 654, 321,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["12:34:56.987654321[foo=bar]", "alone"],
|
||||
["12:34:56.987654321[UTC][foo=bar]", "with time zone"],
|
||||
["12:34:56.987654321[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["T12:34:56.987654321[foo=bar]", "with T"],
|
||||
["T12:34:56.987654321[UTC][foo=bar]", "with T and time zone"],
|
||||
["T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with T and calendar"],
|
||||
["T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with T, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar]", "with date"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar]", "with date and time zone"],
|
||||
["1970-01-01T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with date and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with date, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainDate(2000, 5, 2);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.toZonedDateTime({ plainTime: arg, timeZone: "UTC" });
|
||||
|
||||
assert.sameValue(
|
||||
result.epochNanoseconds,
|
||||
957_270_896_987_654_321n,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
30
test/built-ins/Temporal/PlainDate/prototype/until/argument-string-unknown-annotation.js
vendored
Normal file
30
test/built-ins/Temporal/PlainDate/prototype/until/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainDate(2000, 5, 2);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.until(arg);
|
||||
|
||||
TemporalHelpers.assertDuration(
|
||||
result,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,26 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1976-11-18T15:23[foo=bar]", "alone"],
|
||||
["1976-11-18T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["1976-11-18T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1976-11-18T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1976-11-18T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = Temporal.PlainDateTime.compare(arg, arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1976-11-18T15:23[foo=bar]", "alone"],
|
||||
["1976-11-18T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["1976-11-18T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1976-11-18T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1976-11-18T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = Temporal.PlainDateTime.from(arg);
|
||||
|
||||
TemporalHelpers.assertPlainDateTime(
|
||||
result,
|
||||
1976, 11, "M11", 18, 15, 23, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
28
test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-string-unknown-annotation.js
vendored
Normal file
28
test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1976-11-18T15:23[foo=bar]", "alone"],
|
||||
["1976-11-18T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["1976-11-18T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1976-11-18T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1976-11-18T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainDateTime(1976, 11, 18, 15, 23);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.equals(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
true,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/PlainDateTime/prototype/since/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/PlainDateTime/prototype/since/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1976-11-18T15:23[foo=bar]", "alone"],
|
||||
["1976-11-18T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["1976-11-18T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1976-11-18T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1976-11-18T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainDateTime(1976, 11, 18, 15, 23);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.since(arg);
|
||||
|
||||
TemporalHelpers.assertDuration(
|
||||
result,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/PlainDateTime/prototype/until/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/PlainDateTime/prototype/until/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1976-11-18T15:23[foo=bar]", "alone"],
|
||||
["1976-11-18T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["1976-11-18T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1976-11-18T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1976-11-18T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainDateTime(1976, 11, 18, 15, 23);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.until(arg);
|
||||
|
||||
TemporalHelpers.assertDuration(
|
||||
result,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainDateTime(1976, 11, 18, 15, 23);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.withPlainDate(arg);
|
||||
|
||||
TemporalHelpers.assertPlainDateTime(
|
||||
result,
|
||||
2000, 5, "M05", 2, 15, 23, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,37 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["12:34:56.987654321[foo=bar]", "alone"],
|
||||
["12:34:56.987654321[UTC][foo=bar]", "with time zone"],
|
||||
["12:34:56.987654321[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["T12:34:56.987654321[foo=bar]", "with T"],
|
||||
["T12:34:56.987654321[UTC][foo=bar]", "with T and time zone"],
|
||||
["T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with T and calendar"],
|
||||
["T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with T, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar]", "with date"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar]", "with date and time zone"],
|
||||
["1970-01-01T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with date and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with date, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainDateTime(1976, 11, 18, 15, 23);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.withPlainTime(arg);
|
||||
|
||||
TemporalHelpers.assertPlainDateTime(
|
||||
result,
|
||||
1976, 11, "M11", 18, 12, 34, 56, 987, 654, 321,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1976-05-02T15:23[foo=bar]", "alone"],
|
||||
["1976-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["1976-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1976-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1976-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = Temporal.PlainMonthDay.from(arg);
|
||||
|
||||
TemporalHelpers.assertPlainMonthDay(
|
||||
result,
|
||||
"M05", 2,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
28
test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-string-unknown-annotation.js
vendored
Normal file
28
test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1976-05-02T15:23[foo=bar]", "alone"],
|
||||
["1976-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["1976-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1976-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1976-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainMonthDay(5, 2);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.equals(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
true,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,34 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["12:34:56.987654321[foo=bar]", "alone"],
|
||||
["12:34:56.987654321[UTC][foo=bar]", "with time zone"],
|
||||
["12:34:56.987654321[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["T12:34:56.987654321[foo=bar]", "with T"],
|
||||
["T12:34:56.987654321[UTC][foo=bar]", "with T and time zone"],
|
||||
["T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with T and calendar"],
|
||||
["T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with T, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar]", "with date"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar]", "with date and time zone"],
|
||||
["1970-01-01T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with date and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with date, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = Temporal.PlainTime.compare(arg, arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,35 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["12:34:56.987654321[foo=bar]", "alone"],
|
||||
["12:34:56.987654321[UTC][foo=bar]", "with time zone"],
|
||||
["12:34:56.987654321[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["T12:34:56.987654321[foo=bar]", "with T"],
|
||||
["T12:34:56.987654321[UTC][foo=bar]", "with T and time zone"],
|
||||
["T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with T and calendar"],
|
||||
["T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with T, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar]", "with date"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar]", "with date and time zone"],
|
||||
["1970-01-01T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with date and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with date, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = Temporal.PlainTime.from(arg);
|
||||
|
||||
TemporalHelpers.assertPlainTime(
|
||||
result,
|
||||
12, 34, 56, 987, 654, 321,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
36
test/built-ins/Temporal/PlainTime/prototype/equals/argument-string-unknown-annotation.js
vendored
Normal file
36
test/built-ins/Temporal/PlainTime/prototype/equals/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["12:34:56.987654321[foo=bar]", "alone"],
|
||||
["12:34:56.987654321[UTC][foo=bar]", "with time zone"],
|
||||
["12:34:56.987654321[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["T12:34:56.987654321[foo=bar]", "with T"],
|
||||
["T12:34:56.987654321[UTC][foo=bar]", "with T and time zone"],
|
||||
["T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with T and calendar"],
|
||||
["T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with T, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar]", "with date"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar]", "with date and time zone"],
|
||||
["1970-01-01T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with date and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with date, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.equals(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
true,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
37
test/built-ins/Temporal/PlainTime/prototype/since/argument-string-unknown-annotation.js
vendored
Normal file
37
test/built-ins/Temporal/PlainTime/prototype/since/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["12:34:56.987654321[foo=bar]", "alone"],
|
||||
["12:34:56.987654321[UTC][foo=bar]", "with time zone"],
|
||||
["12:34:56.987654321[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["T12:34:56.987654321[foo=bar]", "with T"],
|
||||
["T12:34:56.987654321[UTC][foo=bar]", "with T and time zone"],
|
||||
["T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with T and calendar"],
|
||||
["T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with T, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar]", "with date"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar]", "with date and time zone"],
|
||||
["1970-01-01T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with date and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with date, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.since(arg);
|
||||
|
||||
TemporalHelpers.assertDuration(
|
||||
result,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.toPlainDateTime(arg);
|
||||
|
||||
TemporalHelpers.assertPlainDateTime(
|
||||
result,
|
||||
2000, 5, "M05", 2, 12, 34, 56, 987, 654, 321,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.toZonedDateTime({ plainDate: arg, timeZone: "UTC" });
|
||||
|
||||
assert.sameValue(
|
||||
result.epochNanoseconds,
|
||||
957_270_896_987_654_321n,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
37
test/built-ins/Temporal/PlainTime/prototype/until/argument-string-unknown-annotation.js
vendored
Normal file
37
test/built-ins/Temporal/PlainTime/prototype/until/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["12:34:56.987654321[foo=bar]", "alone"],
|
||||
["12:34:56.987654321[UTC][foo=bar]", "with time zone"],
|
||||
["12:34:56.987654321[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["T12:34:56.987654321[foo=bar]", "with T"],
|
||||
["T12:34:56.987654321[UTC][foo=bar]", "with T and time zone"],
|
||||
["T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with T and calendar"],
|
||||
["T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with T, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar]", "with date"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar]", "with date and time zone"],
|
||||
["1970-01-01T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with date and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with date, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.until(arg);
|
||||
|
||||
TemporalHelpers.assertDuration(
|
||||
result,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,26 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2019-12-15T15:23[foo=bar]", "alone"],
|
||||
["2019-12-15T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2019-12-15T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2019-12-15T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2019-12-15T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = Temporal.PlainYearMonth.compare(arg, arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2019-12-15T15:23[foo=bar]", "alone"],
|
||||
["2019-12-15T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2019-12-15T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2019-12-15T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2019-12-15T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = Temporal.PlainYearMonth.from(arg);
|
||||
|
||||
TemporalHelpers.assertPlainYearMonth(
|
||||
result,
|
||||
2019, 12, "M12",
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
28
test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-string-unknown-annotation.js
vendored
Normal file
28
test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2019-12-15T15:23[foo=bar]", "alone"],
|
||||
["2019-12-15T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2019-12-15T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2019-12-15T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2019-12-15T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainYearMonth(2019, 12);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.equals(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
true,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/PlainYearMonth/prototype/since/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/PlainYearMonth/prototype/since/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2019-12-15T15:23[foo=bar]", "alone"],
|
||||
["2019-12-15T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2019-12-15T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2019-12-15T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2019-12-15T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainYearMonth(2019, 12);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.since(arg);
|
||||
|
||||
TemporalHelpers.assertDuration(
|
||||
result,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/PlainYearMonth/prototype/until/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/PlainYearMonth/prototype/until/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2019-12-15T15:23[foo=bar]", "alone"],
|
||||
["2019-12-15T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2019-12-15T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2019-12-15T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2019-12-15T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.PlainYearMonth(2019, 12);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.until(arg);
|
||||
|
||||
TemporalHelpers.assertDuration(
|
||||
result,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
28
test/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-string-unknown-annotation.js
vendored
Normal file
28
test/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1976-11-18T15:23[foo=bar]", "alone"],
|
||||
["1976-11-18T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["1976-11-18T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1976-11-18T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1976-11-18T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.TimeZone("UTC");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.getInstantFor(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result.epochNanoseconds,
|
||||
217_178_580_000_000_000n,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00Z[foo=bar]", "alone"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00Z[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1970-01-01T00:00Z[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.TimeZone("UTC");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.getNextTransition(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
null,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00Z[foo=bar]", "alone"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00Z[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1970-01-01T00:00Z[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.TimeZone("UTC");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.getOffsetNanosecondsFor(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00Z[foo=bar]", "alone"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00Z[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1970-01-01T00:00Z[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.TimeZone("UTC");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.getOffsetStringFor(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
"+00:00",
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00Z[foo=bar]", "alone"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00Z[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1970-01-01T00:00Z[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.TimeZone("UTC");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.getPlainDateTimeFor(arg);
|
||||
|
||||
TemporalHelpers.assertPlainDateTime(
|
||||
result,
|
||||
1970, 1, "M01", 1, 0, 0, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [compareArray.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1976-11-18T15:23[foo=bar]", "alone"],
|
||||
["1976-11-18T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["1976-11-18T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1976-11-18T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1976-11-18T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.TimeZone("UTC");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.getPossibleInstantsFor(arg);
|
||||
|
||||
assert.compareArray(
|
||||
result.map(i => i.epochNanoseconds),
|
||||
[217_178_580_000_000_000n],
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00Z[foo=bar]", "alone"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00Z[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["1970-01-01T00:00Z[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["1970-01-01T00:00Z[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.TimeZone("UTC");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.getPreviousTransition(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
null,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,25 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00[UTC][foo=bar][u-ca=iso8601]", "before calendar"],
|
||||
["1970-01-01T00:00[UTC][u-ca=iso8601][foo=bar]", "after calendar"],
|
||||
["1970-01-01T00:00[UTC][foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = Temporal.ZonedDateTime.compare(arg, arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,25 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00[UTC][foo=bar][u-ca=iso8601]", "before calendar"],
|
||||
["1970-01-01T00:00[UTC][u-ca=iso8601][foo=bar]", "after calendar"],
|
||||
["1970-01-01T00:00[UTC][foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = Temporal.ZonedDateTime.from(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result.epochNanoseconds,
|
||||
0n,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
28
test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-unknown-annotation.js
vendored
Normal file
28
test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00[UTC][foo=bar][u-ca=iso8601]", "before calendar"],
|
||||
["1970-01-01T00:00[UTC][u-ca=iso8601][foo=bar]", "after calendar"],
|
||||
["1970-01-01T00:00[UTC][foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
const instance = new Temporal.ZonedDateTime(0n, timeZone);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.equals(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
true,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00[UTC][foo=bar][u-ca=iso8601]", "before calendar"],
|
||||
["1970-01-01T00:00[UTC][u-ca=iso8601][foo=bar]", "after calendar"],
|
||||
["1970-01-01T00:00[UTC][foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
const instance = new Temporal.ZonedDateTime(0n, timeZone);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.since(arg);
|
||||
|
||||
TemporalHelpers.assertDuration(
|
||||
result,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-unknown-annotation.js
vendored
Normal file
29
test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
includes: [temporalHelpers.js]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["1970-01-01T00:00[UTC][foo=bar]", "with time zone"],
|
||||
["1970-01-01T00:00[UTC][foo=bar][u-ca=iso8601]", "before calendar"],
|
||||
["1970-01-01T00:00[UTC][u-ca=iso8601][foo=bar]", "after calendar"],
|
||||
["1970-01-01T00:00[UTC][foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
const instance = new Temporal.ZonedDateTime(0n, timeZone);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.until(arg);
|
||||
|
||||
TemporalHelpers.assertDuration(
|
||||
result,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
const instance = new Temporal.ZonedDateTime(0n, timeZone);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.withPlainDate(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result.epochNanoseconds,
|
||||
957_225_600_000_000_000n,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
@ -0,0 +1,37 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["12:34:56.987654321[foo=bar]", "alone"],
|
||||
["12:34:56.987654321[UTC][foo=bar]", "with time zone"],
|
||||
["12:34:56.987654321[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["T12:34:56.987654321[foo=bar]", "with T"],
|
||||
["T12:34:56.987654321[UTC][foo=bar]", "with T and time zone"],
|
||||
["T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with T and calendar"],
|
||||
["T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with T, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar]", "with date"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar]", "with date and time zone"],
|
||||
["1970-01-01T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with date and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with date, time zone, and calendar"],
|
||||
["1970-01-01T12:34:56.987654321[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const timeZone = new Temporal.TimeZone("UTC");
|
||||
const instance = new Temporal.ZonedDateTime(0n, timeZone);
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.withPlainTime(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result.epochNanoseconds,
|
||||
45_296_987_654_321n,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/intl402/Temporal/Calendar/prototype/era/argument-string-unknown-annotation.js
vendored
Normal file
29
test/intl402/Temporal/Calendar/prototype/era/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.era(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
undefined,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
29
test/intl402/Temporal/Calendar/prototype/eraYear/argument-string-unknown-annotation.js
vendored
Normal file
29
test/intl402/Temporal/Calendar/prototype/eraYear/argument-string-unknown-annotation.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2022 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: Various forms of unknown annotation
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const tests = [
|
||||
["2000-05-02[foo=bar]", "without time"],
|
||||
["2000-05-02T15:23[foo=bar]", "alone"],
|
||||
["2000-05-02T15:23[UTC][foo=bar]", "with time zone"],
|
||||
["2000-05-02T15:23[u-ca=iso8601][foo=bar]", "with calendar"],
|
||||
["2000-05-02T15:23[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"],
|
||||
["2000-05-02T15:23[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"],
|
||||
];
|
||||
|
||||
const instance = new Temporal.Calendar("iso8601");
|
||||
|
||||
tests.forEach(([arg, description]) => {
|
||||
const result = instance.eraYear(arg);
|
||||
|
||||
assert.sameValue(
|
||||
result,
|
||||
undefined,
|
||||
`unknown annotation (${description})`
|
||||
);
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user