Null-DRM-Official/apps/cli/capture_args_test.go
404errordeveloper da8e1123ec
All checks were successful
release / build-and-upload (push) Successful in 7m5s
Streamd v0.2.0: rename, modules panel, stable/beta channels
- Rename product/host binary to streamd (drm compat copy still shipped)
- Go module path streamd; STREAMD_* env aliases; agent UA streamd-agent
- Panel Modules store + agent pull sync (modstore / modsync)
- Rolling stable + beta download tags; README/docs channel curl blocks
- Release notes in docs/releases/v0.2.0.md attached by Forgejo Actions
2026-10-10 15:58:26 +02:00

39 lines
1 KiB
Go

package main
import (
"strings"
"testing"
"streamd/apps/capture/capturecmd"
)
func TestCaptureRejectsChannelAsApp(t *testing.T) {
err := capturecmd.Run([]string{"--app", "bbcone"})
if err == nil {
t.Fatal("expected error for --app bbcone")
}
if !strings.Contains(err.Error(), "--app bbc") || !strings.Contains(err.Error(), "--channel bbcone") {
t.Fatalf("want suggestion for bbc/bbcone, got: %v", err)
}
}
func TestCaptureRejectsLeftoverArgs(t *testing.T) {
err := capturecmd.Run([]string{"--app", "bbc", "bbcone"})
if err == nil {
t.Fatal("expected error for leftover positional args")
}
if !strings.Contains(err.Error(), "unexpected arguments") {
t.Fatalf("got: %v", err)
}
}
func TestCaptureNormalizesEmDashThenSuggestsChannel(t *testing.T) {
// Word/Terminal often turns -- into an em dash: capture —app bbcone
err := capturecmd.Run([]string{"\u2014app", "bbcone"})
if err == nil {
t.Fatal("expected error")
}
if !strings.Contains(err.Error(), "--app bbc") {
t.Fatalf("got: %v", err)
}
}