Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct DurationFormat test #3870

Merged
merged 1 commit into from
Jul 14, 2023
Merged

Correct DurationFormat test #3870

merged 1 commit into from
Jul 14, 2023

Conversation

FrankYFTang
Copy link
Contributor

@FrankYFTang FrankYFTang commented Jul 13, 2023

The expectation values for the formatToParts are incorrect.

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

Compare with the string output in

https://github.com/tc39/test262/blob/main/test/intl402/DurationFormat/prototype/format/style-long-en.js
(notice there are no " and " but only ", ".)
https://github.com/tc39/test262/blob/main/test/intl402/DurationFormat/prototype/format/style-short-en.js
(notice it is "ms", "μs" and "ns", and there are no " and " but only ", ".)
and
https://github.com/tc39/test262/blob/main/test/intl402/DurationFormat/prototype/format/style-default-en.js
(same as above)

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
@FrankYFTang FrankYFTang requested a review from a team as a code owner July 13, 2023 23:10
@FrankYFTang
Copy link
Contributor Author

@ryzokuken @romulocintra @ptomato @sffc
These tests were added in #3771 and I split them into inidivisual one in

#3798

but the expected values were set incorrectly in 3771

Copy link
Contributor

@ptomato ptomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

@ptomato ptomato merged commit 9d7eb80 into tc39:main Jul 14, 2023
1 check passed
@FrankYFTang FrankYFTang deleted the fixDurationTest branch July 19, 2023 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants