Commit Graph

49 Commits

Author SHA1 Message Date
Sosuke Suzuki c00830acef Fix description of `fractionalDigits` tests 2024-05-28 15:41:01 +02:00
Ben Allen 8724a0de23 ListFormats used in DurationFormat/prototype/format/fractions-of-subsecond-units-en.js were missing required `type: "unit"` option 2024-04-29 15:54:34 +02:00
Frank Yung-Fong Tang c2ae5ed5e9 Fix mixed-short-and-numeric.js
The option for the listFormat need to include {type: "unit"}
2024-04-25 10:55:21 +02:00
André Bargull a640565994 Add test for negative zero inputs 2024-04-23 18:27:01 +02:00
André Bargull 859b5c67ef Update numeric-hour-with-zero-minutes-and-non-zero-seconds for new default display of sub-hours units
Numeric "minute" and "seconds" units now default to "always" display, so we have
to add an additional test to cover when "auto" display is used. Additionally add
more inputs to cover all possible test combinations.
2024-04-23 18:27:01 +02:00
André Bargull 19d2a38558 Add tests for negative durations with leading zero unit 2024-04-23 18:27:01 +02:00
André Bargull cadd064174 Use formatDurationFormatPattern for "/numeric-hour-with-zero-minutes-and-non-zero-seconds"
The changes from the first commit allow to use
`formatDurationFormatPattern` for this test.
2024-04-23 18:27:01 +02:00
André Bargull 330ecdd016 Sync partitionDurationFormatPattern with latest spec draft
Sync `partitionDurationFormatPattern` with the latest spec draft and
change it to use an `Intl.DurationFormat` object as the input, so it's
easier to compare it against the spec text and because it allows to test
more inputs.

Includes the fixes for:
- https://github.com/tc39/proposal-intl-duration-format/pull/183
- https://github.com/tc39/proposal-intl-duration-format/pull/184
2024-04-23 18:27:01 +02:00
Ben Allen b37947f3a4 Removed extraneous comment, added roundingMode: 'trunc' to NumberFormat options when fractional digits are formatted to match behaviour of DurationFormat -- doesn't make a difference with these test values, but could with others 2024-04-23 11:30:16 +02:00
Ben Allen 046dff4b33
test formatting when microseconds or nanoseconds are the first numeric-styled unit (#4034)
* test formatting when microseconds or nanoseconds are the first numeric-styled unit

* incorporated Philip Chimento guidance re: padding fractional components
2024-04-11 17:02:37 -07:00
Ben Allen e11ef85b1b
added test for formatting mixture of short and numeric styles (#4033)
* added test for formatting mixture of short and numeric styles

* incorporated Philip Chimento feedback re: making test more general across locales
2024-04-11 16:29:13 -07:00
Frank Tang b37b6f3552 Fix incorrect tests landed in PR3890
https://github.com/tc39/test262/pull/3890
2024-04-11 16:33:56 +02:00
Ben Allen e0a0c27796
DurationFormat: added tests for default styles for units following numeric-styled units (#4032) 2024-04-03 18:09:00 +02:00
Ben Allen 634933a489 DurationFormat: test formatting for units using combinations of "long", "short", and "narrow" styles 2024-03-27 09:49:09 -07:00
Ben Allen 39168e26c8 DurationFormat: changed metadata to list 'en' instead of 'en-US' as locale for tests that actually test 'en' rather than 'en-US' 2024-03-25 15:36:57 -07:00
Ben Allen 0b1abd5ee7
Two tests previously assumed 'en' as locale for DurationFormat, assumption now made explicit (#4019) 2024-03-15 09:35:47 +01:00
Ben Allen af3890a10a update to reflect numeric minutes handling after https://github.com/tc39/proposal-intl-duration-format/pull/180 2024-03-13 12:00:37 +01:00
Ben Allen 80590ce79a Added tests to verify that use of "long", "short", or "narrow" styles for units following units using "numeric" or "2-digit" styles throws 2024-01-10 14:50:08 +01:00
Ben Allen d2a6e21ff9 added missing features: line to metadata for two tests 2023-10-04 15:06:25 -07:00
Ben Allen 47eb8dd685
Update to reflect normative change in formatting when Intl.DurationFormat's fractionalDigits option is undefined (#3890) 2023-10-03 13:32:13 +02:00
André Bargull 99096762ca Use verifyProperty in remaining test/intl402 tests 2023-09-13 16:05:40 +02:00
André Bargull e27c9f690c Add DurationFormat test for negative durations 2023-08-28 16:18:47 +02:00
André Bargull fa3581986f Add test for numeric hours with zero minutes and non-zero seconds 2023-08-28 16:18:47 +02:00
André Bargull c9548956f9 Test exact precision for DurationFormat
`Intl.DurationFormat` is currently spec'ed to use unlimited precision.

See: https://github.com/tc39/proposal-intl-duration-format/issues/157
2023-08-28 16:18:47 +02:00
André Bargull 71091f1541 Use simplified PartitionDurationFormatPattern to computed expected results 2023-08-28 16:18:47 +02:00
André Bargull 4da0b8f005 Remove test which duplicates 'style-default-en.js' 2023-08-28 16:18:47 +02:00
Yusuke Suzuki 04a84fc5fd Fix test/intl402/DurationFormat/prototype/format/style-digital-en.js
The expected output is not aligned: it is missing comma. This change fixes it.
2023-08-21 15:37:04 -07:00
Frank Tang 9d7eb8018e Correct DurationFormat test
The expectation values for the formatToParts are incorrect.

A. The listFormat is consturcted with
  6. Perform ! CreateDataPropertyOrThrow(lfOpts, "type", "unit").
  so it should not have " and " in the string. Comparing with
  (new Intl.ListFormat("en", {type: "unit"})).formatToParts(["a", "b",
  "c"]) and
  value in the format d and the expected values in the
  DurationFormat/prototype/format directory
B. The localized unit values for "short" (and therefore default)
   are incorrect. Comparing with the expected values in the
  DurationFormat/prototype/format directory
2023-07-14 19:13:30 +02:00
Frank Tang beb4f26eb4 Remove unit of ":" in "digital" style. 2023-04-05 16:39:20 +02:00
Frank Tang 4fda9c4c01 Split DurationFormat style tests
For better parallization and reporting
2023-04-05 16:39:20 +02:00
Romulo Cintra b17b9411e0 Update DurationFormat and FormatToParts tests
https://github.com/tc39/proposal-intl-duration-format/pull/126
2023-02-08 10:53:17 -08:00
Frank Yung-Fong Tang dac6956348
sync with duration-format PR130 (#3752)
https://github.com/tc39/proposal-intl-duration-format/pull/130
2022-12-14 16:08:52 +01:00
Frank Yung-Fong Tang 58b7a23582 Sync to intl-duration-format PR 119
Sync to https://github.com/tc39/proposal-intl-duration-format/pull/119
Use "unit" type for listFormat
2022-09-28 13:58:09 -07:00
Frank Yung-Fong Tang 4569e73420
Fix DurationFormat default tests (#3640)
1. add the test for "seconds"
2. since the default value for "style" is "long", baseStyle for GetDurationUnitOptions is "long" and therefore the 
last argument in testOption should be "long"
3. the valid values for "days" does not contains  "numeric", and "2-digit". remove them. 
4. the valid values for "milliseconds", "microseconds" and "nanoseconds" does not contains "2-digit". remove it.

See https://tc39.es/proposal-intl-duration-format/#table-duration-components about the valid value
notice the last colum is for "Digital Default" while the baseStyle is "digital" but the set up does not set it that way, the default value for "style" is "long" as in
```
13. Let style be ? GetOption(options, "style", "string", « "long", "short", "narrow", "digital" », "long").
```
of https://tc39.es/proposal-intl-duration-format/#sec-Intl.DurationFormat

* Sync to PR 121

Change default from "long" to "short"
2022-09-14 12:51:40 -07:00
Frank Yung-Fong Tang 03cff7fcba Remove undefined to sync to PR 113
undefined is no longer value output for resolvedOptions().fractionalDigits
2022-09-14 12:42:53 -07:00
Romulo Cintra 7b2a9bb441
DurationFormat basic format tests (#3604) 2022-07-21 11:07:40 -07:00
Romulo Cintra 91a61b29ac meta: add missing feature flag 2022-07-13 09:16:05 -07:00
Romulo Cintra 6432c9df20
Increase the Intl.DurationFormat Coverage (#3592)
Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2022-07-13 12:23:57 +02:00
Romulo Cintra 392f0049d7 test invalid negative durations objects 2022-07-01 09:26:43 +02:00
Romulo Cintra 28455b13f5
Intl.DurationFormat update coverage (#3501)
* constructor tests coverage
* add localeMatcher tests
* add styles and numbering system tests
* re-organize folder and files structure
2022-05-03 08:19:32 -07:00
Romulo Cintra ffae81a3f6 update assert name and length check 2022-01-26 16:32:15 -05:00
Romulo Cintra 034e5dd201 Update test/intl402/DurationFormat/instance/length.js
Thanks

Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2022-01-26 16:32:15 -05:00
Romulo Cintra 95613d4ec8 update DurationFormat tests 2022-01-26 16:32:15 -05:00
Romulo Cintra 66f4071495 update test 2022-01-24 13:28:44 -05:00
Romulo Cintra e687842030 update tests 2022-01-24 13:28:44 -05:00
Romulo Cintra 9f8ac1aace add instance checks 2022-01-24 13:28:44 -05:00
Frank Yung-Fong Tang 29a0a1e253 Simplify the testing
The last five lines below are simply WRONG and not according to the spec. 

```
const durationFormat = new Intl.DurationFormat();

verifyNotEnumerable(durationFormat, Symbol.toStringTag);
verifyNotWritable(durationFormat, Symbol.toStringTag);
verifyConfigurable(durationFormat, Symbol.toStringTag);
```
2021-12-14 13:37:35 -05:00
Nikhil Singhal 1f16a6ad0e docs: update features 2021-12-03 19:53:31 -05:00
Nikhil Singhal f00ea58ae9 test(Intl.DurationFormat.prototype): check prototype attributes 2021-12-03 19:53:31 -05:00