-
Notifications
You must be signed in to change notification settings - Fork 0
/
cache-manager_test.go
31 lines (23 loc) · 1.36 KB
/
cache-manager_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"fmt"
"testing"
"time"
)
func TestNextUpdate(t *testing.T) {
cm := NewCacheManager(".")
cm.LastUpdate = time.Date(2024, time.January, 5 /*time:*/, 8, 23, 0, 0, time.Local).Unix()
fmt.Printf("%v -> %v\n", time.Unix(cm.LastUpdate, 0), time.Unix(cm.GetNextUpdate(), 0))
cm.LastUpdate = time.Date(2024, time.January, 5 /*time:*/, 8, 30, 0, 0, time.Local).Unix()
fmt.Printf("%v -> %v\n", time.Unix(cm.LastUpdate, 0), time.Unix(cm.GetNextUpdate(), 0))
cm.LastUpdate = time.Date(2024, time.January, 5 /*time:*/, 8, 31, 0, 0, time.Local).Unix()
fmt.Printf("%v -> %v\n", time.Unix(cm.LastUpdate, 0), time.Unix(cm.GetNextUpdate(), 0))
cm.LastUpdate = time.Date(2024, time.January, 5 /*time:*/, 8, 41, 0, 0, time.Local).Unix()
fmt.Printf("%v -> %v\n", time.Unix(cm.LastUpdate, 0), time.Unix(cm.GetNextUpdate(), 0))
cm.LastUpdate = time.Date(2024, time.January, 5 /*time:*/, 8, 51, 0, 0, time.Local).Unix()
fmt.Printf("%v -> %v\n", time.Unix(cm.LastUpdate, 0), time.Unix(cm.GetNextUpdate(), 0))
cm.LastUpdate = time.Date(2024, time.January, 5 /*time:*/, 9, 00, 0, 0, time.Local).Unix()
fmt.Printf("%v -> %v\n", time.Unix(cm.LastUpdate, 0), time.Unix(cm.GetNextUpdate(), 0))
cm.LastUpdate = time.Date(2024, time.January, 5 /*time:*/, 9, 01, 0, 0, time.Local).Unix()
fmt.Printf("%v -> %v\n", time.Unix(cm.LastUpdate, 0), time.Unix(cm.GetNextUpdate(), 0))
}