Undo "fix", @DefaultLocale is used in this test.

This commit is contained in:
Gary Gregory 2020-06-22 09:32:10 -04:00
parent 91dafbcea8
commit 5ffe008074
1 changed files with 12 additions and 24 deletions

View File

@ -232,20 +232,11 @@ public class StringUtilsContainsTest {
public void testContainsIgnoreCase_LocaleIndependence() { public void testContainsIgnoreCase_LocaleIndependence() {
final Locale[] locales = { Locale.ENGLISH, new Locale("tr"), Locale.getDefault() }; final Locale[] locales = { Locale.ENGLISH, new Locale("tr"), Locale.getDefault() };
final String[][] tdata = { final String[][] tdata = { { "i", "I" }, { "I", "i" }, { "\u03C2", "\u03C3" }, { "\u03A3", "\u03C2" },
{ "i", "I" }, { "\u03A3", "\u03C3" }, };
{ "I", "i" },
{ "\u03C2", "\u03C3" },
{ "\u03A3", "\u03C2" },
{ "\u03A3", "\u03C3" },
};
final String[][] fdata = { final String[][] fdata = { { "\u00DF", "SS" }, };
{ "\u00DF", "SS" },
};
final Locale defaultLocale = Locale.getDefault();
try {
for (final Locale testLocale : locales) { for (final Locale testLocale : locales) {
Locale.setDefault(testLocale); Locale.setDefault(testLocale);
for (int j = 0; j < tdata.length; j++) { for (int j = 0; j < tdata.length; j++) {
@ -257,9 +248,6 @@ public class StringUtilsContainsTest {
Locale.getDefault() + ": " + j + " " + fdata[j][0] + " " + fdata[j][1]); Locale.getDefault() + ": " + j + " " + fdata[j][0] + " " + fdata[j][1]);
} }
} }
} finally {
Locale.setDefault(defaultLocale);
}
} }
@Test @Test