Files
sow-tools/internal/assets/run_test.go
T
archvillainetteandClaude Opus 4.8 dd01c96473 feat(assets): seven asset commands + Run dispatch/helpers
check-dupes, clean-dupes, check-mdl, fix-mdl, convert, upscale, compile
behind a single runner indirection, mirroring internal/depot's Run shape.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 14:13:54 +02:00

27 lines
642 B
Go

package assets
import (
"bytes"
"strings"
"testing"
)
func env(string) string { return "" }
func TestRunNoArgsIsUsage(t *testing.T) {
var out, errw bytes.Buffer
if code := Run(nil, &out, &errw, env); code != exitUsage {
t.Fatalf("no args exit = %d, want %d", code, exitUsage)
}
if !strings.Contains(errw.String(), "usage") {
t.Fatalf("no args should print usage, got: %q", errw.String())
}
}
func TestRunUnknownSubcommandIsUsage(t *testing.T) {
var out, errw bytes.Buffer
if code := Run([]string{"frobnicate"}, &out, &errw, env); code != exitUsage {
t.Fatalf("unknown subcommand exit = %d, want %d", code, exitUsage)
}
}