diff --git a/test/intl402/DateTimeFormat/prototype/formatRangeToParts/fractionalSecondDigits.js b/test/intl402/DateTimeFormat/prototype/formatRangeToParts/fractionalSecondDigits.js index 272f466763..1358bc8f6a 100644 --- a/test/intl402/DateTimeFormat/prototype/formatRangeToParts/fractionalSecondDigits.js +++ b/test/intl402/DateTimeFormat/prototype/formatRangeToParts/fractionalSecondDigits.js @@ -27,8 +27,18 @@ const d1 = new Date(2019, 7, 10, 1, 2, 3, 234); const d2 = new Date(2019, 7, 10, 1, 2, 3, 567); const d3 = new Date(2019, 7, 10, 1, 2, 13, 987); +assert.throws(RangeError, () => { + new Intl.DateTimeFormat( + 'en', { minute: "numeric", second: "numeric", fractionalSecondDigits: 0}); + }, "fractionalSecondDigits 0 should throw RangeError for out of range"); + +assert.throws(RangeError, () => { + new Intl.DateTimeFormat( + 'en', { minute: "numeric", second: "numeric", fractionalSecondDigits: 4}); + }, "fractionalSecondDigits 4 should throw RangeError for out of range"); + let dtf = new Intl.DateTimeFormat( - 'en', { minute: "numeric", second: "numeric", fractionalSecondDigits: 0}); + 'en', { minute: "numeric", second: "numeric", fractionalSecondDigits: undefined}); compare(dtf.formatRangeToParts(d1, d2), [ { type: "minute", value: "02", source: "shared" },