(t *testing.T)
| 233 | } |
| 234 | |
| 235 | func TestNewCachesCommand_RequiredFlags(t *testing.T) { |
| 236 | cmd := NewCachesCommand() |
| 237 | |
| 238 | requiredFlags := []string{"ip", "user", "port", "pwd"} |
| 239 | for _, name := range requiredFlags { |
| 240 | flag := cmd.Flags().Lookup(name) |
| 241 | assert.NotNil(t, flag, "flag %q should exist", name) |
| 242 | annotations := flag.Annotations |
| 243 | if annotations != nil { |
| 244 | _, hasRequired := annotations[cobra.BashCompOneRequiredFlag] |
| 245 | assert.True(t, hasRequired, "flag %q should be marked as required", name) |
| 246 | } |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | func TestNewCachesCommand_AliasFlagNotRequired(t *testing.T) { |
| 251 | cmd := NewCachesCommand() |
nothing calls this directly
no test coverage detected