Split ws from jobsearch as a separate test utility rather than a feature of jobsearch

This commit is contained in:
bwilliams committed 2026-10-16 08:58:25 +01:00
1 parent b714ee14d5
commit 5e61c11eb9
9 files changed
+148 -38

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
package main
import (
"slices"
"testing"
)
// The commands are tested in internal/cli/ws. This test checks newRootCmd
// puts them together.
func TestCommandTree(t *testing.T) {
root := newRootCmd()
var names []string
for _, c := range root.Commands() {
names = append(names, c.Name())
}
for _, want := range []string{"dial", "serve"} {
if !slices.Contains(names, want) {
t.Errorf("ws-test has no %q command; has %v", want, names)
}
}
for _, flag := range []string{"config", "debug", "quiet"} {
if root.PersistentFlags().Lookup(flag) == nil {
t.Errorf("ws-test has no --%s flag", flag)
}
}
}