Files
jellybit/cmd/jellybit/recognize_test.go
T

22 lines
729 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package main
import (
"strings"
"testing"
)
func TestRecognize_RequiresInfohash(t *testing.T) {
if err := runRecognize(nil); err == nil || !strings.Contains(err.Error(), "usage") {
t.Errorf("без infohash ожидалась usage-ошибка, got %v", err)
}
}
func TestRecognize_DryRunOnly(t *testing.T) {
// Флаг после позиционного должен разобраться (допарсинг), а --dry-run=false
// — отклониться до обращения к конфигу/сети.
err := runRecognize([]string{"abc123", "--dry-run=false"})
if err == nil || !strings.Contains(err.Error(), "dry-run") {
t.Errorf("ожидалась ошибка про dry-run, got %v", err)
}
}