On Tue, 26 Mar 2024 20:49:48 GMT, Justin Lu <j...@openjdk.org> wrote:

> Please review this PR which updates two MessageFormat sub format related 
> tests to be guaranteed to run under the `en_US` locale.
> 
> There exists locale that do not provide distinct instances for separate 
> styles. For example, the `en_IN` locale provides the same LONG and SHORT 
> compact number instances. The test data is built to test sub formats under 
> the assumption that different styles do provide distinct instances.
> 
> As this is the case, these tests should be ran under a locale that does 
> provide distinct instances for separate styles.

test/jdk/java/text/Format/MessageFormat/CompactSubFormats.java line 29:

> 27:  * @summary Test MessageFormatPattern ability to recognize and produce
> 28:  *          appropriate FormatType and FormatStyle for 
> CompactNumberFormat.
> 29:  * @run junit/othervm -Duser.language=en -Duser.country=US 
> CompactSubFormats

I would instantiate MessageFormat explicitly with the `US` locale (using the 
2-arg constructor), instead of implicitly specifying it with the system 
property.

test/jdk/java/text/Format/MessageFormat/CompactSubFormats.java line 43:

> 41: import static org.junit.jupiter.api.Assertions.assertEquals;
> 42: 
> 43: // This tests expects an en_US locale, as this locale provides distinct 
> instances

Nit: typo tests -> test

test/jdk/java/text/Format/MessageFormat/ListSubFormats.java line 31:

> 29:  *          STANDARD, OR, and UNIT types are supported as built-in 
> patterns for
> 30:  *          MessageFormat. All types use the FULL style.
> 31:  * @run junit/othervm -Duser.language=en -Duser.country=US ListSubFormats

Same as above

test/jdk/java/text/Format/MessageFormat/ListSubFormats.java line 42:

> 40: import static org.junit.jupiter.api.Assertions.assertThrows;
> 41: 
> 42: // This tests expects an en_US locale, as this locale provides distinct 
> instances

ditto

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18498#discussion_r1540157210
PR Review Comment: https://git.openjdk.org/jdk/pull/18498#discussion_r1540157737
PR Review Comment: https://git.openjdk.org/jdk/pull/18498#discussion_r1540157897
PR Review Comment: https://git.openjdk.org/jdk/pull/18498#discussion_r1540157979

Reply via email to