chore: sync local updates
This commit is contained in:
24
mengyaping-backend/config/monitor_interval_test.go
Normal file
24
mengyaping-backend/config/monitor_interval_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package config
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestIsAllowedMonitorInterval(t *testing.T) {
|
||||
if !IsAllowedMonitorInterval(10) || !IsAllowedMonitorInterval(360) {
|
||||
t.Fatal("expected 10 and 360 allowed")
|
||||
}
|
||||
if IsAllowedMonitorInterval(5) || IsAllowedMonitorInterval(45) {
|
||||
t.Fatal("expected 5 and 45 disallowed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSnapMonitorIntervalMinutes(t *testing.T) {
|
||||
if SnapMonitorIntervalMinutes(5) != 10 {
|
||||
t.Fatalf("5 -> 10, got %d", SnapMonitorIntervalMinutes(5))
|
||||
}
|
||||
if SnapMonitorIntervalMinutes(7) != 10 {
|
||||
t.Fatalf("7 -> 10, got %d", SnapMonitorIntervalMinutes(7))
|
||||
}
|
||||
if SnapMonitorIntervalMinutes(25) != 20 {
|
||||
t.Fatalf("25 -> 20, got %d", SnapMonitorIntervalMinutes(25))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user