gogcli/internal/cmd/completion_test.go
2025-12-31 17:24:31 +01:00

26 lines
551 B
Go

package cmd
import (
"context"
"strings"
"testing"
)
func TestCompletionCmd(t *testing.T) {
cases := []string{"bash", "zsh", "fish", "powershell"}
for _, shell := range cases {
shell := shell
t.Run(shell, func(t *testing.T) {
out := captureStdout(t, func() {
cmd := &CompletionCmd{Shell: shell}
if err := cmd.Run(context.Background()); err != nil {
t.Fatalf("run: %v", err)
}
})
if !strings.Contains(out, "Completion scripts not supported") {
t.Fatalf("expected completion output, got %q", out)
}
})
}
}