fix(detect): wire up ports package for OpenBSD detection

The ports package was fully implemented but detect_openbsd.go still
returned nil candidates with a stale TODO. Wire up ports.New() so
OpenBSD systems can auto-detect their package manager.

Also adds:
- Unit tests for GetCapabilities with mock managers (base + full)
- Unit tests for Locker mutual exclusion
- Edge case tests for ports parser (empty input, whitespace, fallback)
- Minor dep updates (charmbracelet/ultraviolet, charmbracelet/x)
This commit is contained in:
2026-03-05 09:03:38 +00:00
parent 397e865107
commit 90ca983200
6 changed files with 228 additions and 9 deletions

View File

@@ -2,12 +2,18 @@
package detect
import (
"github.com/gogrlx/snack"
"github.com/gogrlx/snack/ports"
)
// candidates returns manager factories in probe order for OpenBSD.
// TODO: wire up ports.New() once the ports package is implemented.
func candidates() []managerFactory {
return nil
return []managerFactory{
func() snack.Manager { return ports.New() },
}
}
func allManagers() []managerFactory {
return nil
return candidates()
}