(t *testing.T)
| 1096 | } |
| 1097 | |
| 1098 | func TestIntSliceFlagApply_UsesEnvValues_noDefault(t *testing.T) { |
| 1099 | t.Setenv("MY_GOAT", "1 , 2") |
| 1100 | |
| 1101 | fl := &Int64SliceFlag{Name: "goat", Sources: EnvVars("MY_GOAT")} |
| 1102 | cmd := &Command{ |
| 1103 | Flags: []Flag{ |
| 1104 | fl, |
| 1105 | }, |
| 1106 | } |
| 1107 | r := require.New(t) |
| 1108 | r.NoError(cmd.Run(buildTestContext(t), []string{""})) |
| 1109 | r.NoError(fl.PostParse()) |
| 1110 | r.Equal([]int64{1, 2}, cmd.Value("goat")) |
| 1111 | } |
| 1112 | |
| 1113 | func TestIntSliceFlagApply_UsesEnvValues_withDefault(t *testing.T) { |
| 1114 | t.Setenv("MY_GOAT", "1 , 2") |
nothing calls this directly
no test coverage detected
searching dependent graphs…