Fix bug in test.

This commit is contained in:
Gary Gregory 2020-06-22 09:28:58 -04:00
parent b7b4ae33dc
commit 64b2f90d20
1 changed files with 12 additions and 7 deletions

View File

@ -244,16 +244,21 @@ public class StringUtilsContainsTest {
{ "\u00DF", "SS" },
};
for (final Locale testLocale : locales) {
Locale.setDefault(testLocale);
for (int j = 0; j < tdata.length; j++) {
assertTrue(StringUtils.containsIgnoreCase(tdata[j][0], tdata[j][1]),
final Locale defaultLocale = Locale.getDefault();
try {
for (final Locale testLocale : locales) {
Locale.setDefault(testLocale);
for (int j = 0; j < tdata.length; j++) {
assertTrue(StringUtils.containsIgnoreCase(tdata[j][0], tdata[j][1]),
Locale.getDefault() + ": " + j + " " + tdata[j][0] + " " + tdata[j][1]);
}
for (int j = 0; j < fdata.length; j++) {
assertFalse(StringUtils.containsIgnoreCase(fdata[j][0], fdata[j][1]),
}
for (int j = 0; j < fdata.length; j++) {
assertFalse(StringUtils.containsIgnoreCase(fdata[j][0], fdata[j][1]),
Locale.getDefault() + ": " + j + " " + fdata[j][0] + " " + fdata[j][1]);
}
}
} finally {
Locale.setDefault(defaultLocale);
}
}