diff --git a/test/intl402/DateTimeFormat/prototype/formatRange/date-x-greater-than-y-throws.js b/test/intl402/DateTimeFormat/prototype/formatRange/date-x-greater-than-y-not-throws.js similarity index 77% rename from test/intl402/DateTimeFormat/prototype/formatRange/date-x-greater-than-y-throws.js rename to test/intl402/DateTimeFormat/prototype/formatRange/date-x-greater-than-y-not-throws.js index 57e6ae592b..d5539520c6 100644 --- a/test/intl402/DateTimeFormat/prototype/formatRange/date-x-greater-than-y-throws.js +++ b/test/intl402/DateTimeFormat/prototype/formatRange/date-x-greater-than-y-not-throws.js @@ -1,9 +1,9 @@ -// Copyright 2019 Google, Inc. All rights reserved. +// Copyright 2022 Google, Inc. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- description: > - Throws a RangeError if date x is greater than y. + Return a string if date x is greater than y. info: | Intl.DateTimeFormat.prototype.formatRange ( startDate , endDate ) @@ -17,7 +17,6 @@ info: | 2. If x is NaN, throw a RangeError exception. 3. Let y be TimeClip(y). 4. If y is NaN, throw a RangeError exception. - 5. If x is greater than y, throw a RangeError exception. features: [Intl.DateTimeFormat-formatRange] ---*/ @@ -28,10 +27,7 @@ var x = new Date(); var y = new Date(); x.setDate(y.getDate() + 1); -assert.throws(RangeError, function() { - dtf.formatRange(x, y); -}, "x > y"); - +assert.sameValue("string", typeof dtf.formatRange(x, y)); assert.sameValue("string", typeof dtf.formatRange(x, x)); assert.sameValue("string", typeof dtf.formatRange(y, y)); assert.sameValue("string", typeof dtf.formatRange(y, x)); diff --git a/test/intl402/DateTimeFormat/prototype/formatRangeToParts/date-x-greater-than-y-throws.js b/test/intl402/DateTimeFormat/prototype/formatRangeToParts/date-x-greater-than-y-not-throws.js similarity index 77% rename from test/intl402/DateTimeFormat/prototype/formatRangeToParts/date-x-greater-than-y-throws.js rename to test/intl402/DateTimeFormat/prototype/formatRangeToParts/date-x-greater-than-y-not-throws.js index c7c095bf0f..ac0cfe3bfe 100644 --- a/test/intl402/DateTimeFormat/prototype/formatRangeToParts/date-x-greater-than-y-throws.js +++ b/test/intl402/DateTimeFormat/prototype/formatRangeToParts/date-x-greater-than-y-not-throws.js @@ -1,9 +1,9 @@ -// Copyright 2019 Google, Inc. All rights reserved. +// Copyright 2022 Google, Inc. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- description: > - Throws a RangeError if date x is greater than y. + Return an object if date x is greater than y. info: | Intl.DateTimeFormat.prototype.formatRangeToParts ( startDate , endDate ) @@ -12,13 +12,10 @@ info: | 6. Return ? FormatDateTimeRangeToParts(dtf, x, y). PartitionDateTimeRangePattern ( dateTimeFormat, x, y ) - 1. Let x be TimeClip(x). 2. If x is NaN, throw a RangeError exception. 3. Let y be TimeClip(y). 4. If y is NaN, throw a RangeError exception. - 5. If x is greater than y, throw a RangeError exception. - features: [Intl.DateTimeFormat-formatRange] ---*/ @@ -28,9 +25,7 @@ var x = new Date(); var y = new Date(); x.setDate(y.getDate() + 1); -assert.throws(RangeError, function() { - dtf.formatRangeToParts(x, y); -}, "x > y"); +assert.sameValue("object", typeof dtf.formatRangeToParts(x, y)); assert.sameValue("object", typeof dtf.formatRangeToParts(x, x)); assert.sameValue("object", typeof dtf.formatRangeToParts(y, y)); assert.sameValue("object", typeof dtf.formatRangeToParts(y, x));