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