mirror of
https://github.com/taigrr/most-specific-period.git
synced 2026-04-02 03:38:41 -07:00
Add gap test
This commit is contained in:
@@ -240,6 +240,26 @@ func TestGenerateTime(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
testID: "periods with a gap in the middle",
|
||||||
|
ts: now,
|
||||||
|
result: []string{
|
||||||
|
fmt.Sprintf("A\t%s\t%s\n", now.Add(-time.Minute*10), now.Add(-time.Minute*5)),
|
||||||
|
fmt.Sprintf("B\t%s\t%s\n", now.Add(time.Minute*5), now.Add(time.Minute*10)),
|
||||||
|
},
|
||||||
|
periods: []Period{
|
||||||
|
TimeWindow{
|
||||||
|
StartTime: now.Add(-time.Minute * 10),
|
||||||
|
EndTime: now.Add(-time.Minute * 5),
|
||||||
|
Identifier: "A",
|
||||||
|
},
|
||||||
|
TimeWindow{
|
||||||
|
StartTime: now.Add(time.Minute * 5),
|
||||||
|
EndTime: now.Add(time.Minute * 10),
|
||||||
|
Identifier: "B",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
|
|||||||
Reference in New Issue
Block a user