From 68ec6971b872d8be561e8c2c2748c6c143bfef7d Mon Sep 17 00:00:00 2001 From: aur-build Date: Fri, 20 Nov 2026 20:14:27 +0000 Subject: pkgver: move the pure version and dependency tests into the module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ten tests in tests/versions.rs were unit tests of pkgver wearing an integration test's clothing: the comparison vectors, the chunk rule, the epoch rules, the dependency grammar, the constraint checks, the recorded oracle. None of them touched a database or a fixture. They were written against the crate's public API because that was the only way to reach them from outside, and that single fact — that a test had to import a name to exercise it — is what had been keeping five items public: vercmp_string, Dep, DepOp, Dep::satisfied_by, split_full_version All five are private now. `vercmp_string` is called by `vercmp` and by nothing else; `Dep` and `DepOp` are the internals of `dep_names`, which *is* used in production; `satisfied_by` and `Dep::name` are used only by this module's tests, so they are gated rather than merely private, and `cargo check --release` without the test-support feature compiles clean, which is the proof that nothing production needs them was left behind. The oracle test now resolves testcorpus/ through CARGO_MANIFEST_DIR rather than the harness helper, so it no longer depends on the working directory. The live pacman differential came with it and stays gated on AUR_LIVE_VERCMP, recording its absence the same way. What remains in tests/versions.rs is two tests that genuinely need the harness: they build a package, publish it, and move its upstream. pkgver: 14 pub / 5 test-only -> 8 pub / 0 test-only. Suite: 281 passed, 0 failed. --- tests/architecture-budget.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/architecture-budget.json') diff --git a/tests/architecture-budget.json b/tests/architecture-budget.json index 4df78b1..93578fb 100644 --- a/tests/architecture-budget.json +++ b/tests/architecture-budget.json @@ -210,15 +210,15 @@ "test": 0 }, "pkgver": { - "dead": 5, + "dead": 0, "deadonly": 0, "glob": 0, - "largest": 343, + "largest": 545, "largest_file": "src/pkgver/mod.rs", - "lines": 343, + "lines": 545, "priv": 0, - "pub": 14, - "test": 5 + "pub": 8, + "test": 0 }, "recipe": { "dead": 0, @@ -310,15 +310,15 @@ } }, "totals": { - "dead": 105, + "dead": 100, "deadonly": 33, "edges": 87, "glob": 0, "largest": 603, "largest_file": "src/shims/mod.rs", - "lines": 14291, + "lines": 14493, "priv": 109, - "pub": 505, - "test": 72 + "pub": 499, + "test": 67 } } -- cgit v1.2.3