Add parser

This commit is contained in:
vshcherb 2013-08-31 00:23:36 +02:00
parent 57cb0b1531
commit 4aa06675ce

View file

@ -461,6 +461,7 @@ public class OpeningHoursParser {
// check 24/7
if("24/7".equals(r)){
Arrays.fill(days, true);
Arrays.fill(months, true);
basic.addTimeRange(0, 24*60);
rs.addRule(basic);
return true;
@ -664,6 +665,9 @@ public class OpeningHoursParser {
boolean calculated = hours.isOpenedForTime(cal);
System.out.printf(" %sok: Expected %s: %b = %b\n",
((calculated != expected) ? "NOT " : ""), time, expected, calculated);
if(calculated != expected) {
throw new IllegalArgumentException("BUG!!!");
}
}
public static void main(String[] args) throws ParseException {