Fix tests

This commit is contained in:
Victor Shcherb 2015-05-10 01:25:23 +02:00
parent 2395dc4551
commit 5cd40baff3

View file

@ -781,6 +781,7 @@ public class OpeningHoursParser {
// test day wrap as seen on OSM
// Incorrectly evaluated: https://wiki.openstreetmap.org/w/index.php?title=Key:opening_hours/specification#explain:additional_rule_separator
// <normal_rule_separator> does overwrite previous definitions.
// VICTOR: Do we have a test for incorrectly evaluated?
hours = parseOpenedHours("Tu-Th 07:00-2:00; Fr 17:00-4:00; Sa 18:00-05:00; Su,Mo off");
System.out.println(hours);
testOpened("05.05.2013 04:59", hours, true);
@ -794,19 +795,25 @@ public class OpeningHoursParser {
testOpened("08.05.2013 02:00", hours, false);
// test day wrap as seen on OSM
hours = parseOpenedHours("Mo-Th 09:00-03:00, Fr-Sa 09:00-04:00; Su off");
System.out.println("FIXME (disabled some tests): " + hours);
hours = parseOpenedHours("Mo-Th 09:00-03:00; Fr-Sa 09:00-04:00; Su off");
testOpened("11.05.2015 08:59", hours, false);
testOpened("11.05.2015 09:00", hours, true);
testOpened("11.05.2015 09:01", hours, true);
testOpened("12.05.2015 02:59", hours, true);
testOpened("12.05.2015 03:00", hours, false);
// testOpened("16.05.2015 03:59", hours, true); // FIXME: Wrong
testOpened("16.05.2015 04:00", hours, false);
testOpened("17.05.2015 01:00", hours, false);
testOpened("17.05.2015 15:00", hours, false);
testOpened("16.05.2015 03:59", hours, true);
testOpened("16.05.2015 04:01", hours, false);
testOpened("17.05.2015 01:00", hours, true);
testOpened("17.05.2015 04:01", hours, false);
// FIXME: Does throw an exception
// hours = parseOpenedHours("Tu-Th 07:00-2:00; Fr 17:00-4:00; Sa 18:00-05:00; Su,Mo off");
hours = parseOpenedHours("Tu-Th 07:00-2:00; Fr 17:00-4:00; Sa 18:00-05:00; Su,Mo off");
testOpened("11.05.2015 08:59", hours, false);
testOpened("11.05.2015 09:01", hours, false);
testOpened("12.05.2015 02:59", hours, false);
testOpened("12.05.2015 03:00", hours, false);
testOpened("16.05.2015 03:59", hours, true);
testOpened("16.05.2015 04:01", hours, false);
testOpened("17.05.2015 01:00", hours, true);
testOpened("17.05.2015 05:01", hours, false);
// tests single month value
hours = parseOpenedHours("May: 07:00-19:00");