package main import ( "testing" ) func TestEditCommandExists(t *testing.T) { if editCmd == nil { t.Fatal("editCmd should not be nil") } if editCmd.Use != "edit " { t.Errorf("expected Use 'edit ', got '%s'", editCmd.Use) } if editCmd.Short == "" { t.Error("Short description should not be empty") } } func TestEditCommandFlags(t *testing.T) { expectedFlags := []string{"host", "port", "user", "password", "key", "auth-type", "group", "tags", "notes", "name"} for _, flagName := range expectedFlags { if editCmd.Flags().Lookup(flagName) == nil { t.Errorf("flag '%s' should be defined", flagName) } } } func TestEditArgs(t *testing.T) { if editCmd.Args == nil { t.Error("Args validator should not be nil") } }