(t *testing.T)
| 204 | } |
| 205 | |
| 206 | func TestStringSlice(t *testing.T) { |
| 207 | result := StringSlice("empty", "hi") |
| 208 | Parse() |
| 209 | |
| 210 | exp := []string{"hi"} |
| 211 | if !reflect.DeepEqual(exp, *result) { |
| 212 | t.Fatalf("expected %v, got %v", exp, *result) |
| 213 | } |
| 214 | |
| 215 | err := os.Setenv("string-slice-key", "hello,world") |
| 216 | if err != nil { |
| 217 | t.Fatal("unexpected error", err) |
| 218 | } |
| 219 | |
| 220 | result = StringSlice("string-slice-key", "hi") |
| 221 | Parse() |
| 222 | |
| 223 | exp = []string{"hello", "world"} |
| 224 | if !reflect.DeepEqual(exp, *result) { |
| 225 | t.Fatalf("expected %v, got %v", exp, *result) |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | func TestStringSliceVar(t *testing.T) { |
| 230 | var result []string |
nothing calls this directly
no test coverage detected