refactor: move V1 code into v1/ subdirectory
- git mv cmd/ internal/ pkg/ test/ go.mod go.sum Makefile build.sh docs/ v1/ - Create v1/README.md with V1 documentation - Update root README for V1 + V2 structure - V1 still builds (cd v1 && go build ./cmd/hostkeeper) and 105 tests pass - Root is now clean for V2 development
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDeleteCommandExists(t *testing.T) {
|
||||
if deleteCmd == nil {
|
||||
t.Fatal("deleteCmd should not be nil")
|
||||
}
|
||||
|
||||
if deleteCmd.Use != "delete <host-name-or-id>" {
|
||||
t.Errorf("expected Use 'delete <host-name-or-id>', got '%s'", deleteCmd.Use)
|
||||
}
|
||||
|
||||
if deleteCmd.Short == "" {
|
||||
t.Error("Short description should not be empty")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeleteCommandFlags(t *testing.T) {
|
||||
expectedFlags := []string{"force"}
|
||||
for _, flagName := range expectedFlags {
|
||||
if deleteCmd.Flags().Lookup(flagName) == nil {
|
||||
t.Errorf("flag '%s' should be defined", flagName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeleteArgs(t *testing.T) {
|
||||
if deleteCmd.Args == nil {
|
||||
t.Error("Args validator should not be nil")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user