chore: sync local updates

This commit is contained in:
2026-05-16 19:03:32 +08:00
parent 360a5f15b9
commit aff88ba97d
47 changed files with 3651 additions and 12175 deletions

View 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))
}
}