Files
wehub-resource-sync e071084ebe
govulncheck / govulncheck (push) Has been cancelled
Lint / golangci-lint (push) Has been cancelled
Run Tests / Unit Tests (push) Has been cancelled
Run Tests / Etcd Integration Tests (push) Has been cancelled
Harness (E2E) / Harnesses (mock LLM) (push) Has been cancelled
Harness (E2E) / Provider harnesses (live LLM conformance) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:40:33 +08:00

30 lines
691 B
Go

package resource
import "testing"
func TestCommandsRegistered(t *testing.T) {
// Each command func must return a command with a name and at least
// one subcommand, so the resource surface stays consistent.
for _, fn := range commandFuncs {
c := fn()
if c.Name == "" {
t.Error("command with empty name")
}
if len(c.Subcommands) == 0 {
t.Errorf("command %q has no subcommands", c.Name)
}
}
}
func TestExpectedCommands(t *testing.T) {
names := map[string]bool{}
for _, fn := range commandFuncs {
names[fn().Name] = true
}
for _, want := range []string{"registry", "broker", "store", "config"} {
if !names[want] {
t.Errorf("missing %q command", want)
}
}
}