Files
felhom.eu/hub/internal/osupdates/r855_docker_nights_test.go
T

16 lines
561 B
Go

package osupdates
import "testing"
// R-855: the start log and the approval rule read the same effective count. The TEST override
// OS_DOCKER_APPROVE_NIGHTS=0 is stored as -1 ("none") and must print 0, never -1; the zero value is
// the default 2.
func TestDockerNightsEffective(t *testing.T) {
for _, tc := range []struct{ raw, want int }{{-1, 0}, {0, 2}, {3, 3}, {2, 2}} {
s := &Service{DockerNights: tc.raw}
if got := s.DockerNightsEffective(); got != tc.want {
t.Errorf("DockerNights=%d → effective %d, want %d", tc.raw, got, tc.want)
}
}
}