fixed issues with CA now generates its own new cert
All checks were successful
release / build-and-upload (push) Successful in 16m53s
All checks were successful
release / build-and-upload (push) Successful in 16m53s
This commit is contained in:
parent
a930a697fa
commit
c1948a1439
11 changed files with 458 additions and 34 deletions
41
apps/cli/capture_args_test.go
Normal file
41
apps/cli/capture_args_test.go
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"drmdecryption/apps/capture/capturecmd"
|
||||
|
||||
_ "drmdecryption/modules/all"
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue