lib: Add unit tests for Package, ProcFilter, PackageFilter, and TarIo #106

Merged
Jan Lindemann merged 4 commits from jan/feature/20260914-lib-add-unit-tests-for-package-procfilter-packagefilter-and-tario into master 2026-09-14 21:04:49 +02:00 AGit

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.

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.
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.

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1
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().

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1
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.

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1
lib.TarIo: Add unit tests
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m15s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m42s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m8s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m25s
CI / Packaging test (push) Successful in 0s
58cb969aaa
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.

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-09-14 20:53:01 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!106
No description provided.