package m9zApi import "testing" func TestNormalizeLoopCount(t *testing.T) { tests := []struct { name string in int want int }{ {name: "default when empty", in: 0, want: defaultLoopCount}, {name: "default when negative", in: -1, want: defaultLoopCount}, {name: "keeps valid value", in: 6, want: 6}, {name: "clamps max value", in: 12, want: maxLoopCount}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if got := normalizeLoopCount(tt.in); got != tt.want { t.Fatalf("normalizeLoopCount(%d) = %d, want %d", tt.in, got, tt.want) } }) } }