email-mcp/internal/cli/app_test.go
2026-04-10 09:34:33 +02:00

27 lines
545 B
Go

package cli
import (
"strings"
"testing"
)
func TestAppRunRejectsUnknownCommand(t *testing.T) {
app := NewApp(nil, nil, nil, nil)
err := app.Run([]string{"unknown"})
if err == nil {
t.Fatal("expected error for unknown command")
}
}
func TestAppRunShowsUsageWhenNoArgsProvided(t *testing.T) {
app := NewApp(nil, nil, nil, nil)
err := app.Run(nil)
if err == nil {
t.Fatal("expected error for missing command")
}
if !strings.Contains(err.Error(), "usage:") {
t.Fatalf("expected usage text in error, got %q", err.Error())
}
}