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

2026-09-14

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
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
2026-09-14 20:53:00 +02:00
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.

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

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1
2026-09-14 20:52:59 +02:00
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.

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1
2026-09-14 20:52:59 +02:00