Merge pull request #6671 from hvdwolf/master

REDO: avoid test failing on non en-US default-locale (#6106)
This commit is contained in:
vshcherb 2019-04-12 18:22:00 +02:00 committed by GitHub
commit 37919b2f77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,6 +113,9 @@ public class OpeningHoursParserTest {
// 0. not properly supported
// hours = parseOpenedHours("Mo-Su (sunrise-00:30)-(sunset+00:30)");
Locale locale = Locale.getDefault();
try {
Locale.setDefault(Locale.forLanguageTag("en-US"));
OpeningHours hours = parseOpenedHours("Apr 05-Oct 24: Fr 08:00-16:00");
System.out.println(hours);
testOpened("26.08.2018 15:00", hours, false);
@ -167,6 +170,7 @@ public class OpeningHoursParserTest {
testOpened("24.08.2018 15:00", hours, false);
testOpened("12.04.2019 15:00", hours, true);
// test basic case
hours = parseOpenedHours("Mo-Fr 08:30-14:40"); //$NON-NLS-1$
System.out.println(hours);
@ -443,6 +447,10 @@ public class OpeningHoursParserTest {
hours = parseOpenedHours("Mo-Fr 10:00-21:00; Sa 12:00-23:00; PH \"Wird auf der Homepage bekannt gegeben.\"");
testParsedAndAssembledCorrectly("Mo-Fr 10:00-21:00; Sa 12:00-23:00; PH - Wird auf der Homepage bekannt gegeben.", hours);
System.out.println(hours);
} finally {
Locale.setDefault(locale);
}
}
private static OpeningHours parseOpenedHours(String string) {