diff options
Diffstat (limited to 'js/src/tests/test262/intl402/DurationFormat/prototype/format/invalid-negative-duration-throws.js')
-rw-r--r-- | js/src/tests/test262/intl402/DurationFormat/prototype/format/invalid-negative-duration-throws.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/invalid-negative-duration-throws.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/invalid-negative-duration-throws.js new file mode 100644 index 0000000000..b349ee52f7 --- /dev/null +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/invalid-negative-duration-throws.js @@ -0,0 +1,25 @@ +// |reftest| skip -- Intl.DurationFormat is not supported +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.DurationFormat.prototype.format +description: format basic tests for invalid negative duration objects that should throw RangeError exception. +features: [Intl.DurationFormat] +---*/ + + + +const df = new Intl.DurationFormat(); + +assert.throws(RangeError, () => { df.format({ + hours : -1, + minutes: 10 +}), "Throws when mixing negative and positive values" }); + +assert.throws(RangeError, () => { df.format({ + hours : 2, + minutes: -10 +}), "Throws when mixing negative and positive values" }); + +reportCompare(0, 0); |