package tools import ( "testing" "time" ) func TestBoundedSSHTimeout(t *testing.T) { cases := []struct { name string in time.Duration want time.Duration }{ {name: "non-positive", in: 0, want: time.Second}, {name: "normal", in: 60 * time.Second, want: 60 * time.Second}, {name: "too-large", in: 24 * time.Hour, want: 300 * time.Second}, } for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { if got := boundedSSHTimeout(tc.in); got != tc.want { t.Fatalf("boundedSSHTimeout(%v)=%v, want %v", tc.in, got, tc.want) } }) } }