Files
snack/detect/detect_test.go
Tai Groot ca2fdd49ac feat: implement detect package and snack CLI
- detect: auto-detection with Default(), All(), ByName()
  - Platform-specific probing via build tags (linux, freebsd, openbsd)
  - Linux probe order: apt, dnf, pacman, apk, flatpak, snap
- cmd/snack: full CLI with cobra + charmbracelet/fang
  - Subcommands: install, remove, purge, upgrade, update, list, search,
    info, which, hold, unhold, clean, detect, version
  - Global flags: --manager, --sudo, --yes, --dry-run
  - Capability type-assertions for FileOwner, Holder, Cleaner
- detect: basic compilation tests
2026-02-26 01:08:27 +00:00

23 lines
435 B
Go

package detect
import (
"testing"
)
func TestByNameUnknown(t *testing.T) {
_, err := ByName("nonexistent")
if err == nil {
t.Fatal("expected error for unknown manager")
}
}
func TestAllReturnsSlice(t *testing.T) {
// Just verify it doesn't panic; actual availability depends on system.
_ = All()
}
func TestDefaultDoesNotPanic(t *testing.T) {
// May return error if no managers available; that's fine.
_, _ = Default()
}