From 9d0072df3d1897a63738b029b3e8d00df18d1201 Mon Sep 17 00:00:00 2001 From: Frank Yung-Fong Tang <41213225+FrankYFTang@users.noreply.github.com> Date: Fri, 21 Jun 2019 10:44:42 -0700 Subject: [PATCH] Fixes {format,formatToParts}/en-us-numeric-auto.js (#2207) The following lines expect each unit has property "-1" and "1" ``` const expected = unit in exceptions ? [exceptions[unit]["1"], exceptions[unit]["0"], exceptions[unit]["0"], exceptions[unit]["-1"]] : [`in 1 ${unit}`, `in 0 ${unit}s`, `0 ${unit}s ago`, `1 ${unit} ago`]; ``` --- .../prototype/format/en-us-numeric-auto.js | 8 ++++++-- .../prototype/formatToParts/en-us-numeric-auto.js | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) 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 3f96dbe3d3..7402150d7a 100644 --- a/test/intl402/RelativeTimeFormat/prototype/format/en-us-numeric-auto.js +++ b/test/intl402/RelativeTimeFormat/prototype/format/en-us-numeric-auto.js @@ -51,10 +51,14 @@ const exceptions = { "1": "tomorrow", }, "hour": { - '0': 'this hour' + "-1": "1 hour ago", + '0': 'this hour', + "1": "in 1 hour", }, "minute": { - '0': 'this minute' + "-1": "1 minute ago", + '0': 'this minute', + "1": "in 1 minute", }, "second": { "-1": "1 second ago", 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 00f319bb86..bb6fb347b3 100644 --- a/test/intl402/RelativeTimeFormat/prototype/formatToParts/en-us-numeric-auto.js +++ b/test/intl402/RelativeTimeFormat/prototype/formatToParts/en-us-numeric-auto.js @@ -46,6 +46,12 @@ function expected(key, unit, default_) { "0": "today", "1": "tomorrow", }, + "hour": { + "0": "this hour", + }, + "minute": { + "0": "this minute", + }, "second": { "0": "now", },