lib: Add unit tests for Package, ProcFilter, PackageFilter, and TarIo #106
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/feature/20260914-lib-add-unit-tests-for-package-procfilter-packagefilter-and-tario"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR adds unit tests for the pure-logic parts of four jw.pkg.lib modules (Package, ProcFilter, PackageFilter, and TarIo).
lib.Package: Add unit tests
parse_spec_str(), parse_specs_str(), order_tags(), and repr are pure text processing without test coverage, shared by the dpkg and rpm package manager backends.
Add unit tests for valid and invalid spec strings, multi-line input with and without a trailing newline, tag ordering with default values, and the repr layout.
lib.ProcFilter: Add unit tests
ProcPipeline and the run() helper are pure logic without test coverage.
Add unit tests for the identity filter, chained filter execution order, the append() layouts, and the chain handling of run().
lib.PackageFilter: Add unit tests
PackageFilterString is pure regex logic without test coverage.
Add unit tests for the url=~ filter, packages without a url, whitespace around the operator, and the rejection of unsupported filter definitions.
lib.TarIo: Add unit tests
TarIo._match() and _filter_tar_file() are pure logic without test coverage.
Add unit tests for the exact path matching, the unfiltered round trip, filtered extraction with a matched list, and a filter without hits.