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

Add plural rules API tests #212

Open
echeran opened this issue Mar 25, 2024 · 2 comments
Open

Add plural rules API tests #212

echeran opened this issue Mar 25, 2024 · 2 comments

Comments

@echeran
Copy link
Collaborator

echeran commented Mar 25, 2024

No description provided.

@echeran echeran added this to the 2024 Q2 milestone Mar 25, 2024
@sffc
Copy link
Member

sffc commented Mar 26, 2024

CLDR has plural rules tests in the form of samples in the plural rules files:

https://github.com/unicode-org/cldr/blob/c7e39f13da2bfbaf58c1447d610627511c7a6549/common/supplemental/plurals.xml

For example:

        <pluralRules locales="sl">
            <pluralRule count="one">v = 0 and i % 100 = 1 @integer 1, 101, 201, 301, 401, 501, 601, 701, 1001, …</pluralRule>
            <pluralRule count="two">v = 0 and i % 100 = 2 @integer 2, 102, 202, 302, 402, 502, 602, 702, 1002, …</pluralRule>
            <pluralRule count="few">v = 0 and i % 100 = 3..4 or v != 0 @integer 3, 4, 103, 104, 203, 204, 303, 304, 403, 404, 503, 504, 603, 604, 703, 704, 1003, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …</pluralRule>
            <pluralRule count="other"> @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …</pluralRule>
        </pluralRules>

The things following @integer and @decimal are test cases.

@sven-oly
Copy link
Collaborator

sven-oly commented Apr 8, 2024

We also need to handle "compact" format, indicated with a "c" instead of "e" in an exponential format.

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

No branches or pull requests

3 participants