(t *testing.T)
| 825 | } |
| 826 | |
| 827 | func TestStringSliceFlagApply_UsesEnvValues_withDefault(t *testing.T) { |
| 828 | t.Setenv("MY_GOAT", "vincent van goat,scape goat") |
| 829 | val := []string{`some default`, `values here`} |
| 830 | fl := &StringSliceFlag{Name: "goat", Sources: EnvVars("MY_GOAT"), Value: val} |
| 831 | cmd := &Command{ |
| 832 | Flags: []Flag{ |
| 833 | fl, |
| 834 | }, |
| 835 | } |
| 836 | err := cmd.Run(buildTestContext(t), []string{""}) |
| 837 | assert.NoError(t, err) |
| 838 | assert.Equal(t, []string{"vincent van goat", "scape goat"}, cmd.Value("goat")) |
| 839 | } |
| 840 | |
| 841 | func TestStringSliceFlagApply_DefaultValueWithDestination(t *testing.T) { |
| 842 | defValue := []string{"UA", "US"} |
nothing calls this directly
no test coverage detected