From 00730511da5a7a7cc7a28c1dd8f1ac27fe8e427c Mon Sep 17 00:00:00 2001 From: Frank Tang Date: Fri, 8 Sep 2023 21:54:53 -0700 Subject: [PATCH] Add tests for DurationFormat PR 172 and 167 Test the order of resolvedOptions in default setting Also add test to check the reading order of options based on the property returned in the default setting resolvedOptions. https://github.com/tc39/proposal-intl-duration-format/pull/167 https://github.com/tc39/proposal-intl-duration-format/pull/172 https://tc39.es/proposal-intl-duration-format/#sec-Intl.DurationFormat.prototype.resolvedOptions These two PRs are presenting to TC39 2023-09 meeting --- .../return-keys-order-default.js | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/intl402/DurationFormat/prototype/resolvedOptions/return-keys-order-default.js diff --git a/test/intl402/DurationFormat/prototype/resolvedOptions/return-keys-order-default.js b/test/intl402/DurationFormat/prototype/resolvedOptions/return-keys-order-default.js new file mode 100644 index 00000000000..ecfb5b33c93 --- /dev/null +++ b/test/intl402/DurationFormat/prototype/resolvedOptions/return-keys-order-default.js @@ -0,0 +1,33 @@ +// Copyright 2023 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-intl.durationformat.prototype.resolvedoptions +description: order of property keys for the object returned by resolvedOptions() +features: [Intl.DurationFormat] +---*/ + +assert.sameValue( + 'locale,' + + 'numberingSystem,' + + 'style,' + + 'years,' + + 'yearsDisplay,' + + 'months,' + + 'monthsDisplay,' + + 'weeks,' + + 'weeksDisplay,' + + 'days,' + + 'daysDisplay,' + + 'hours,' + + 'hoursDisplay,' + + 'minutes,' + + 'minutesDisplay,' + + 'seconds,' + + 'secondsDisplay,' + + 'milliseconds,' + + 'millisecondsDisplay,' + + 'microseconds,' + + 'microsecondsDisplay,' + + 'nanoseconds,' + + 'nanosecondsDisplay', + Object.keys((new Intl.DurationFormat()).resolvedOptions()).toString());