Commit Graph

4 Commits

Author SHA1 Message Date
1fa7de6d66 feat: add PackageUpgrade to Capabilities, exhaustive detect + CLI tests
- Add PackageUpgrade field to Capabilities struct and GetCapabilities
- Add PackageUpgrade to all 11 provider capability tests
- Add pkg-upgrade to CLI detect command output
- Expand detect tests: ByName for all managers, concurrent Reset,
  HasBinary, candidates/allManagers coverage
- Add cmd/snack unit tests: targets, opts, getManager, version
- 838 tests passing, 0 failures
2026-03-06 01:07:35 +00:00
60b68060e7 test(dpkg,apk): exhaustive tests for dpkg extras, fix apk parseInfoNameVersion panic
- dpkg: add normalize_test.go with NormalizeName/ParseArch table tests
- dpkg: add capabilities, DryRunner, interface compliance, parse edge cases
- apk: fix parseInfoNameVersion panic on empty input
- apk: add empty/whitespace test cases for parseInfoNameVersion

807 tests passing, 0 failures.
2026-03-06 01:07:35 +00:00
c34b7a467c test: exhaustive unit tests for all provider-specific interfaces
Add 740 total tests (up from ~200) covering:
- Compile-time interface compliance for all providers
- GetCapabilities assertions for every provider
- Parse function edge cases: empty, malformed, single-entry, multi-entry
- apt: extract inline parse logic into testable functions (parsePolicyCandidate,
  parseUpgradeSimulation, parseHoldList, parseOwner, parseSourcesLine)
- dnf/rpm: edge cases for both dnf4 and dnf5 parsers, normalize/parseArch
- pacman/aur: parseUpgrades, parseGroupPkgSet, capabilities
- apk: parseUpgradeSimulation, parseListLine, SupportsDryRun
- flatpak/snap: semverCmp, stripNonNumeric edge cases
- pkg/ports: all parse functions with thorough edge cases

Every provider now has:
- Interface compliance checks (what it implements AND what it doesn't)
- Capabilities test via snack.GetCapabilities()
- Parse function unit tests with table-driven edge cases
2026-03-06 01:07:35 +00:00
6480c1142d feat(apk): implement apk-tools package manager wrapper
Implements the snack.Manager interface for Alpine Linux's apk-tools:
- Install, Remove, Purge, Upgrade, Update operations
- List installed, Search, Info, IsInstalled, Version queries
- Output parsing for apk list, search, and info formats
- Linux-only implementation with build-tag stubs for other platforms
- Options support: WithSudo, WithDryRun, WithRoot
- Tests for all output parsing functions
2026-02-25 20:24:10 +00:00