Ignore:
Timestamp:
2020-06-16T20:21:16+02:00 (4 years ago)
Author:
simon04
Message:

fix #19397 - JosmDecimalFormatSymbolsProvider is not used for locale en_IE or de_AT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/tools/JosmDecimalFormatSymbolsProviderTest.java

    r13124 r16660  
    33
    44import static org.junit.Assert.assertEquals;
     5import static org.junit.Assert.assertTrue;
    56
     7import java.text.DecimalFormat;
    68import java.util.Locale;
     9import java.util.stream.Stream;
    710
    811import org.junit.Rule;
     
    2427    public JOSMTestRules test = new JOSMTestRules();
    2528
     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
    2642    /**
    2743     * Test {@link JosmDecimalFormatSymbolsProvider#parseDouble}.
Note: See TracChangeset for help on using the changeset viewer.