Skip to content

Commit

Permalink
Issue #50. Different standards for Locale between Java releases
Browse files Browse the repository at this point in the history
  • Loading branch information
averbraeck committed Nov 2, 2024
1 parent 3c7bfe9 commit 5cc7f98
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions djutils-cli/src/test/java/org/djutils/cli/TestCliLocale.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,10 @@ public void testCli() throws CliException
args = new String[] {"--duration", "0,5s", "--locale", "no_NO"};
CliUtil.execute(options, args);
assertEquals(new Duration(0.5, DurationUnit.SECOND), options.getDuration());
args = new String[] {"--duration", "0.5s", "--locale", "no_NO_NY"};
// Issue #50. This locale is not constant between Java versions and even Java releases of the same version
args = new String[] {"--duration", "10s", "--locale", "no_NO_NY"};
CliUtil.execute(options, args);
assertEquals(new Duration(0.5, DurationUnit.SECOND), options.getDuration());
args = new String[] {"--duration", "0.5s", "--locale", "no-NO-NY"};
CliUtil.execute(options, args);
assertEquals(new Duration(0.5, DurationUnit.SECOND), options.getDuration());
assertEquals(new Duration(10.0, DurationUnit.SECOND), options.getDuration());
assertEquals(locale, Locale.getDefault());

Locale.setDefault(saveLocale);
Expand Down

0 comments on commit 5cc7f98

Please sign in to comment.