557629d2bf
gates / gates (push) Successful in 2m3s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
16 lines
561 B
Go
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)
|
|
}
|
|
}
|
|
}
|