unicode-org / conformance

Unicode & CLDR Data Driven Testing
https://unicode-org.github.io/conformance/
Other
5 stars 12 forks source link

Plural Rules test: Node doesn't support legacy locales, e.g., "mo", "tl", "iw", "sh", etc. #306

Open sven-oly opened 1 month ago

sven-oly commented 1 month ago

Node JS tests for plural rules give "unsupported_locale" for legacy locales. The executor gets what locales are supported and adds it to the output, but does not use the actual supported locale in the test.

Example: NodeJS on ICU75.

Input: {"test_type": "plural_rules", "locale":"mo","label":"5741","type":"ordinal","plural_type":"ordinal","sample":"1000","hexhash":"e46fa8ef9d6e9606ac1a9f64afe6af02519b41a9"}

Output: {"test_type": "plural_rules", "unsupported_locale":"mo","supported_locals":["ro"],"test_options":{"type":"ordinal"}}

ICU4C and ICU4J seem to mostly support these locales, but not consistently, e.g., ICU4C on ICU75.

expect "few" but actual result is "other"{"locale":"mo","label":"3719","type":"cardinal","plural_type":"cardinal","sample":"100.0","hexhash":"70f44dcd8014753dd93bcb15a0dc1d1f9f434a7d"}

ICU4X seems to report "other" as the result for these tests in legacy locales, which gives failures in many cases where the expected result is not "other".

Possible solutions:

  1. Update the test generation to map old locales to modern ones, i.e., "iw" --> "he", "mo" --> "ro".
  2. In test generation, include a test for both the old locale and the modern one.
  3. Make the executors recognize legacy locales and perform this mapping.
  4. Don't change current behavior.
sffc commented 3 days ago

I think, catch this as a known_issue