diff --git a/test/intl402/RelativeTimeFormat/prototype/format/en-us-numeric-auto.js b/test/intl402/RelativeTimeFormat/prototype/format/en-us-numeric-auto.js index b123d76a17fecdc4142961fdf2a2eefba3cd4ce6..19a4b8aea728005246dc760addb0f320fed62597 100644 --- a/test/intl402/RelativeTimeFormat/prototype/format/en-us-numeric-auto.js +++ b/test/intl402/RelativeTimeFormat/prototype/format/en-us-numeric-auto.js @@ -30,6 +30,11 @@ const exceptions = { "0": "this year", "1": "next year", }, + "quarter": { + "-1": "last quarter", + "0": "this quarter", + "1": "next quarter", + }, "month": { "-1": "last month", "0": "this month", diff --git a/test/intl402/RelativeTimeFormat/prototype/format/en-us-style-short.js b/test/intl402/RelativeTimeFormat/prototype/format/en-us-style-short.js index d62341a937cdf869949962867e13a5ce67f79430..b292aadececaa996def5a08e30caae87a9e1ea71 100644 --- a/test/intl402/RelativeTimeFormat/prototype/format/en-us-style-short.js +++ b/test/intl402/RelativeTimeFormat/prototype/format/en-us-style-short.js @@ -9,14 +9,14 @@ locale: [en-US] ---*/ const units = { - "second": "sec.", - "minute": "min.", - "hour": "hr.", - "day": undefined, - "week": "wk.", - "month": "mo.", - "quarter": "qtr.", - "year": "yr.", + "second": ["sec."], + "minute": ["min."], + "hour": ["hr."], + "day": ["day", "days"], + "week": ["wk."], + "month": ["mo."], + "quarter": ["qtr.", "qtrs."], + "year": ["yr."], }; const rtf = new Intl.RelativeTimeFormat("en-US", { @@ -25,9 +25,8 @@ const rtf = new Intl.RelativeTimeFormat("en-US", { assert.sameValue(typeof rtf.format, "function", "format should be supported"); -for (const [unitArgument, unitString] of Object.entries(units)) { - const singular = unitString || `${unitArgument}`; - const plural = unitString || `${unitArgument}s`; +for (const [unitArgument, unitStrings] of Object.entries(units)) { + const [singular, plural = singular] = unitStrings; assert.sameValue(rtf.format(1000, unitArgument), `in 1,000 ${plural}`); assert.sameValue(rtf.format(10, unitArgument), `in 10 ${plural}`); assert.sameValue(rtf.format(2, unitArgument), `in 2 ${plural}`); diff --git a/test/intl402/RelativeTimeFormat/prototype/formatToParts/en-us-numeric-auto.js b/test/intl402/RelativeTimeFormat/prototype/formatToParts/en-us-numeric-auto.js index be604222cdc7ded7eb2684115d05176a55e01126..a7f39ae821e9d417d8e8e0a31efaedcce7e39f1d 100644 --- a/test/intl402/RelativeTimeFormat/prototype/formatToParts/en-us-numeric-auto.js +++ b/test/intl402/RelativeTimeFormat/prototype/formatToParts/en-us-numeric-auto.js @@ -26,6 +26,11 @@ function expected(key, unit, default_) { "0": "this year", "1": "next year", }, + "quarter": { + "-1": "last quarter", + "0": "this quarter", + "1": "next quarter", + }, "month": { "-1": "last month", "0": "this month", diff --git a/test/intl402/RelativeTimeFormat/prototype/formatToParts/en-us-style-short.js b/test/intl402/RelativeTimeFormat/prototype/formatToParts/en-us-style-short.js index b85809b5f5176f0166c600aa306057f57387b159..2ff39cf60864f1f3089eb7a8b8297a14a5ce4f2b 100644 --- a/test/intl402/RelativeTimeFormat/prototype/formatToParts/en-us-style-short.js +++ b/test/intl402/RelativeTimeFormat/prototype/formatToParts/en-us-style-short.js @@ -19,14 +19,14 @@ function verifyFormatParts(actual, expected, message) { } const units = { - "second": "sec.", - "minute": "min.", - "hour": "hr.", - "day": undefined, - "week": "wk.", - "month": "mo.", - "quarter": "qtr.", - "year": "yr.", + "second": ["sec."], + "minute": ["min."], + "hour": ["hr."], + "day": ["day", "days"], + "week": ["wk."], + "month": ["mo."], + "quarter": ["qtr.", "qtrs."], + "year": ["yr."], }; const rtf = new Intl.RelativeTimeFormat("en-US", { @@ -35,9 +35,8 @@ const rtf = new Intl.RelativeTimeFormat("en-US", { assert.sameValue(typeof rtf.formatToParts, "function", "formatToParts should be supported"); -for (const [unitArgument, unitString] of Object.entries(units)) { - const singular = unitString || `${unitArgument}`; - const plural = unitString || `${unitArgument}s`; +for (const [unitArgument, unitStrings] of Object.entries(units)) { + const [singular, plural = singular] = unitStrings; verifyFormatParts(rtf.formatToParts(1000, unitArgument), [ { "type": "literal", "value": "in " },