Changeset 16660 in josm for trunk/test/unit/org/openstreetmap/josm/tools
- Timestamp:
- 2020-06-16T20:21:16+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/JosmDecimalFormatSymbolsProviderTest.java
r13124 r16660 3 3 4 4 import static org.junit.Assert.assertEquals; 5 import static org.junit.Assert.assertTrue; 5 6 7 import java.text.DecimalFormat; 6 8 import java.util.Locale; 9 import java.util.stream.Stream; 7 10 8 11 import org.junit.Rule; … … 24 27 public JOSMTestRules test = new JOSMTestRules(); 25 28 29 @Test 30 public void testGroupingSeparator() { 31 checkGroupingSymbol(Locale.ROOT); 32 assertTrue(I18n.getAvailableTranslations().count() > 10); 33 I18n.getAvailableTranslations().forEach(this::checkGroupingSymbol); 34 Stream.of("", "AU", "IE", "US", "UK").map(country -> new Locale("en", country, "")).forEach(this::checkGroupingSymbol); 35 Stream.of("", "AT", "CH", "DE").map(country -> new Locale("de", country, "")).forEach(this::checkGroupingSymbol); 36 } 37 38 private void checkGroupingSymbol(Locale locale) { 39 assertEquals(locale.toString(), "123\u202F456", DecimalFormat.getInstance(locale).format(123_456)); 40 } 41 26 42 /** 27 43 * Test {@link JosmDecimalFormatSymbolsProvider#parseDouble}.
Note:
See TracChangeset
for help on using the changeset viewer.