Temporal: Add tests for PlainTime string disambiguation with calendar

This implements the normative change in
https://github.com/tc39/proposal-temporal/pull/2287 which reached
consensus at the July 2022 TC39 meeting.

It adds tests that ensure that PlainTime strings which require a T
designator for disambiguation, are not disambiguated by adding a calendar
annotation.
This commit is contained in:
Philip Chimento 2022-08-16 16:22:00 -07:00 committed by Philip Chimento
parent d8e8529e8d
commit 409d6dc71a
9 changed files with 72 additions and 0 deletions

View File

@ -16,6 +16,14 @@ const ambiguousStrings = [
"1130", // ditto, including DD that doesn't occur in every month
"12-14", // ambiguity between MM-DD and HH-UU
"202112", // ambiguity between YYYYMM and HHMMSS
// same strings as above but with a calendar annotation, which must not cause
// disambiguation in favour of time
"2021-12[u-ca=iso8601]",
"1214[u-ca=iso8601]",
"0229[u-ca=iso8601]",
"1130[u-ca=iso8601]",
"12-14[u-ca=iso8601]",
"202112[u-ca=iso8601]",
];
ambiguousStrings.forEach((string) => {
let arg = string;

View File

@ -16,6 +16,14 @@ const ambiguousStrings = [
"1130", // ditto, including DD that doesn't occur in every month
"12-14", // ambiguity between MM-DD and HH-UU
"202112", // ambiguity between YYYYMM and HHMMSS
// same strings as above but with a calendar annotation, which must not cause
// disambiguation in favour of time
"2021-12[u-ca=iso8601]",
"1214[u-ca=iso8601]",
"0229[u-ca=iso8601]",
"1130[u-ca=iso8601]",
"12-14[u-ca=iso8601]",
"202112[u-ca=iso8601]",
];
ambiguousStrings.forEach((string) => {
let arg = string;

View File

@ -16,6 +16,14 @@ const ambiguousStrings = [
"1130", // ditto, including DD that doesn't occur in every month
"12-14", // ambiguity between MM-DD and HH-UU
"202112", // ambiguity between YYYYMM and HHMMSS
// same strings as above but with a calendar annotation, which must not cause
// disambiguation in favour of time
"2021-12[u-ca=iso8601]",
"1214[u-ca=iso8601]",
"0229[u-ca=iso8601]",
"1130[u-ca=iso8601]",
"12-14[u-ca=iso8601]",
"202112[u-ca=iso8601]",
];
ambiguousStrings.forEach((string) => {
let arg = string;

View File

@ -16,6 +16,14 @@ const ambiguousStrings = [
"1130", // ditto, including DD that doesn't occur in every month
"12-14", // ambiguity between MM-DD and HH-UU
"202112", // ambiguity between YYYYMM and HHMMSS
// same strings as above but with a calendar annotation, which must not cause
// disambiguation in favour of time
"2021-12[u-ca=iso8601]",
"1214[u-ca=iso8601]",
"0229[u-ca=iso8601]",
"1130[u-ca=iso8601]",
"12-14[u-ca=iso8601]",
"202112[u-ca=iso8601]",
];
ambiguousStrings.forEach((string) => {
let arg = string;

View File

@ -14,6 +14,14 @@ const ambiguousStrings = [
"1130", // ditto, including DD that doesn't occur in every month
"12-14", // ambiguity between MM-DD and HH-UU
"202112", // ambiguity between YYYYMM and HHMMSS
// same strings as above but with a calendar annotation, which must not cause
// disambiguation in favour of time
"2021-12[u-ca=iso8601]",
"1214[u-ca=iso8601]",
"0229[u-ca=iso8601]",
"1130[u-ca=iso8601]",
"12-14[u-ca=iso8601]",
"202112[u-ca=iso8601]",
];
ambiguousStrings.forEach((string) => {
let arg = string;

View File

@ -16,6 +16,14 @@ const ambiguousStrings = [
"1130", // ditto, including DD that doesn't occur in every month
"12-14", // ambiguity between MM-DD and HH-UU
"202112", // ambiguity between YYYYMM and HHMMSS
// same strings as above but with a calendar annotation, which must not cause
// disambiguation in favour of time
"2021-12[u-ca=iso8601]",
"1214[u-ca=iso8601]",
"0229[u-ca=iso8601]",
"1130[u-ca=iso8601]",
"12-14[u-ca=iso8601]",
"202112[u-ca=iso8601]",
];
ambiguousStrings.forEach((string) => {
let arg = string;

View File

@ -16,6 +16,14 @@ const ambiguousStrings = [
"1130", // ditto, including DD that doesn't occur in every month
"12-14", // ambiguity between MM-DD and HH-UU
"202112", // ambiguity between YYYYMM and HHMMSS
// same strings as above but with a calendar annotation, which must not cause
// disambiguation in favour of time
"2021-12[u-ca=iso8601]",
"1214[u-ca=iso8601]",
"0229[u-ca=iso8601]",
"1130[u-ca=iso8601]",
"12-14[u-ca=iso8601]",
"202112[u-ca=iso8601]",
];
ambiguousStrings.forEach((string) => {
let arg = string;

View File

@ -16,6 +16,14 @@ const ambiguousStrings = [
"1130", // ditto, including DD that doesn't occur in every month
"12-14", // ambiguity between MM-DD and HH-UU
"202112", // ambiguity between YYYYMM and HHMMSS
// same strings as above but with a calendar annotation, which must not cause
// disambiguation in favour of time
"2021-12[u-ca=iso8601]",
"1214[u-ca=iso8601]",
"0229[u-ca=iso8601]",
"1130[u-ca=iso8601]",
"12-14[u-ca=iso8601]",
"202112[u-ca=iso8601]",
];
ambiguousStrings.forEach((string) => {
let arg = string;

View File

@ -16,6 +16,14 @@ const ambiguousStrings = [
"1130", // ditto, including DD that doesn't occur in every month
"12-14", // ambiguity between MM-DD and HH-UU
"202112", // ambiguity between YYYYMM and HHMMSS
// same strings as above but with a calendar annotation, which must not cause
// disambiguation in favour of time
"2021-12[u-ca=iso8601]",
"1214[u-ca=iso8601]",
"0229[u-ca=iso8601]",
"1130[u-ca=iso8601]",
"12-14[u-ca=iso8601]",
"202112[u-ca=iso8601]",
];
ambiguousStrings.forEach((string) => {
let arg = string;