Added check for valid interval in Add function. Added overlap testcases.

This commit is contained in:
Daniel Gil
2018-05-30 17:16:04 +02:00
parent 5128012518
commit 98c89357f5
7 changed files with 825 additions and 211 deletions

View File

@@ -13,7 +13,8 @@ const (
// Intervals is an interface to handle Interval structures discovering the existence of gaps or overlays
type Intervals interface {
Add(itvl *Interval)
// Add appends a new interval to the list. If the interval range (low, high) is invalid, it returns an error
Add(itvl *Interval) error
// Sort sorts the intervals list by the Low property (ascending)
Sort()