(t *testing.T)
| 1111 | } |
| 1112 | |
| 1113 | func TestIntSliceFlagApply_UsesEnvValues_withDefault(t *testing.T) { |
| 1114 | t.Setenv("MY_GOAT", "1 , 2") |
| 1115 | val := []int64{3, 4} |
| 1116 | fl := &Int64SliceFlag{Name: "goat", Sources: EnvVars("MY_GOAT"), Value: val} |
| 1117 | cmd := &Command{ |
| 1118 | Flags: []Flag{ |
| 1119 | fl, |
| 1120 | }, |
| 1121 | } |
| 1122 | r := require.New(t) |
| 1123 | r.NoError(cmd.Run(buildTestContext(t), []string{""})) |
| 1124 | r.Equal([]int64{3, 4}, val) |
| 1125 | r.Equal([]int64{1, 2}, cmd.Value("goat")) |
| 1126 | } |
| 1127 | |
| 1128 | func TestIntSliceFlagApply_DefaultValueWithDestination(t *testing.T) { |
| 1129 | defValue := []int64{1, 2} |
nothing calls this directly
no test coverage detected