package daemon import "testing" func TestFirstNonEmpty(t *testing.T) { cases := []struct { name string values []string want string }{ {"all empty", []string{"", " ", "\t"}, ""}, {"first wins", []string{"a", "b"}, "a"}, {"skips blanks", []string{"", " ", "first", "second"}, "first"}, {"nil input", nil, ""}, } for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { got := firstNonEmpty(tc.values...) if got != tc.want { t.Errorf("firstNonEmpty(%v) = %q, want %q", tc.values, got, tc.want) } }) } }