if (result.isEmpty) return
if (result.tail.isEmpty) return
if (result.head.to.after(result.tail.head.from))
- fail("Effectivity timeslots not successive: %s %s".format(result.head, result.tail.head))
+ fail("Timeslots not successive: %s %s".format(result.head, result.tail.head))
testSuccessiveTimeslots(result.tail)
}
+
+ @tailrec
+ final def testNoGaps(result: List[Timeslot]): Unit = {
+ if (result.isEmpty) return
+ if (result.tail.isEmpty) return
+ if (result.head.to.getTime != result.tail.head.from.getTime + 1)
+ fail("Timeslots not successive: %s %s".format(result.head, result.tail.head))
+ testNoGaps(result.tail)
+ }
}
\ No newline at end of file