-
Notifications
You must be signed in to change notification settings - Fork 464
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
Add tests for Intl.PluralRules.prototype.resolvedOptions().pluralCategories
order
#4275
Open
ben-allen
wants to merge
3
commits into
tc39:main
Choose a base branch
from
ben-allen:pluralrules-sort-order-pr-918
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
18e3e85
Add tests for `Intl.PluralRules.prototype.resolvedOptions().pluralCat…
ben-allen 4641f37
fixup! Add tests for `Intl.PluralRules.prototype.resolvedOptions().pl…
ben-allen 8c9180e
fixup! fixup! Add tests for `Intl.PluralRules.prototype.resolvedOptio…
ben-allen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
test/intl402/PluralRules/prototype/resolvedOptions/plural-categories-order.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2024 Igalia S.L. All rights reserved. | ||
// This code is governed by the license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-intl.pluralrules.prototype.resolvedoptions | ||
description: > | ||
Tests that Intl.PluralRules.prototype.resolvedOptions elements given in correct order. | ||
info: | | ||
Intl.PluralRules.prototype.resolvedOptions () | ||
|
||
4. Let pluralCategories be a List of Strings containing all possible results of PluralRuleSelect for the selected locale pr.[[Locale]], sorted according to the following order: "zero", "one", "two", "few", "many", "other". | ||
|
||
includes: [compareArray.js] | ||
locale: [ar, en, fa, fr, gv, ko, sl] | ||
---*/ | ||
|
||
assert.compareArray(new Intl.PluralRules('ar').resolvedOptions().pluralCategories, ['zero', 'one', 'two', 'few', 'many', 'other'], "pluralCategories order or contents incorrect for 'ar' locale"); | ||
assert.compareArray(new Intl.PluralRules('en').resolvedOptions().pluralCategories, ['one', 'other'], "pluralCategories order or contents incorrect for 'en' locale"); | ||
assert.compareArray(new Intl.PluralRules('fa').resolvedOptions().pluralCategories, ['one', 'other'], "pluralCategories order or contents incorrect for 'fa' locale"); | ||
assert.compareArray(new Intl.PluralRules('fr').resolvedOptions().pluralCategories, ['one', 'many', 'other'], "pluralCategories order or contents incorrect for 'fr' locale"); | ||
assert.compareArray(new Intl.PluralRules('gv').resolvedOptions().pluralCategories, ['one', 'two', 'few', 'many', 'other'], "pluralCategories order or contents incorrect for 'gv' locale"); | ||
assert.compareArray(new Intl.PluralRules('ko').resolvedOptions().pluralCategories, ['other'], "pluralCategories order or contents incorrect for 'ko' locale"); | ||
|
||
assert.compareArray(new Intl.PluralRules('sl').resolvedOptions().pluralCategories, ['one', 'two', 'few', 'other'], "pluralCategories order or contents incorrect for 'sl' locale"); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the spurious empty lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d'oh. fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You seem to have missed the one between ko and sl, I'm afraid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sigh. Sorry about that, should be fixed now