Merge pull request #1192 from ypid/opening_hours_added_tests
Added test for "Mo-Th 09:00-03:00, Fr-Sa 09:00-04:00; Su off". Not evaluated correctly. Related to #1154.
This commit is contained in:
commit
2395dc4551
1 changed files with 18 additions and 2 deletions
|
@ -1,6 +1,5 @@
|
|||
package net.osmand.util;
|
||||
/* Has to be commented out in order to run the main function and test the package? */
|
||||
|
||||
/* Can be commented out in order to run the main function separately */
|
||||
|
||||
|
||||
import java.text.ParseException;
|
||||
|
@ -780,6 +779,8 @@ public class OpeningHoursParser {
|
|||
testOpened("06.05.2013 10:00", hours, false);
|
||||
|
||||
// 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.
|
||||
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);
|
||||
|
@ -792,6 +793,21 @@ public class OpeningHoursParser {
|
|||
testOpened("08.05.2013 00:00", hours, true);
|
||||
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);
|
||||
testOpened("11.05.2015 08:59", hours, false);
|
||||
testOpened("11.05.2015 09:00", 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);
|
||||
|
||||
// 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");
|
||||
|
||||
// tests single month value
|
||||
hours = parseOpenedHours("May: 07:00-19:00");
|
||||
System.out.println(hours);
|
||||
|
|
Loading…
Reference in a new issue