(t *testing.T)
| 227 | } |
| 228 | |
| 229 | func TestStringSliceVar(t *testing.T) { |
| 230 | var result []string |
| 231 | StringSliceVar(&result, "empty", "hi") |
| 232 | Parse() |
| 233 | |
| 234 | exp := []string{"hi"} |
| 235 | if !reflect.DeepEqual(exp, result) { |
| 236 | t.Fatalf("expected %v, got %v", exp, result) |
| 237 | } |
| 238 | |
| 239 | err := os.Setenv("string-slice-key", "hello,world") |
| 240 | if err != nil { |
| 241 | t.Fatal("unexpected error", err) |
| 242 | } |
| 243 | |
| 244 | StringSliceVar(&result, "string-slice-key", "hi", "there") |
| 245 | Parse() |
| 246 | |
| 247 | exp = []string{"hello", "world"} |
| 248 | if !reflect.DeepEqual(exp, result) { |
| 249 | t.Fatalf("expected %v, got %v", exp, result) |
| 250 | } |
| 251 | } |
nothing calls this directly
no test coverage detected