diff options
| author | aur-build <aur-build@localhost> | 2026-11-21 14:01:34 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-21 14:01:34 +0000 |
| commit | 47f6c6db7faedc292fb55b6637a5f6e292ffcaec (patch) | |
| tree | 3baf3934f00d7280e649d48de3a6cf19d88a09ec /testcorpus/git-submodules | |
| parent | 7afffd1a0ca798dd5826c2e1881b09fe135dbcbd (diff) | |
| download | aur-build-47f6c6db7faedc292fb55b6637a5f6e292ffcaec.tar.gz aur-build-47f6c6db7faedc292fb55b6637a5f6e292ffcaec.zip | |
tests: make the blanket `allow(dead_code)` in the test tier worth keeping
`tests/common/mod.rs` opened with `#![allow(dead_code)]` and nothing else, which
means it could have been hiding helpers no test called. It was not hiding many —
`upstream2_commit` and nothing else at file scope — but "not many" is not a
check, and the file cannot simply drop the allowance: it is compiled into every
test binary, so a helper one binary uses is dead code in the other twenty and
the lint fires everywhere and means nothing.
So the allowance stays and the check moves up a level. `the_test_helpers_are_used`
reads the file and fails on any `pub` item no test writes, counting a type as
used when a field or method of it is — `Web::raw_request` hands back a `Raw` no
test ever names. `every_fixture_is_referenced` does the same for `testcorpus/`,
which had one entry, `git-submodules`, that no test had ever driven; it is gone.
Both were checked by planting a dead helper and a dead fixture and watching the
suite refuse them.
`tests/dispatch.rs` also carried a function whose entire body was an
`#[allow(dead_code)]` on `fn unused(_: AtomicBool, _: Config) {}` — the deadest
code in the repository, with its two imports behind it.
Diffstat (limited to 'testcorpus/git-submodules')
| -rw-r--r-- | testcorpus/git-submodules/PKGBUILD | 15 | ||||
| -rw-r--r-- | testcorpus/git-submodules/manifest.json | 28 |
2 files changed, 0 insertions, 43 deletions
diff --git a/testcorpus/git-submodules/PKGBUILD b/testcorpus/git-submodules/PKGBUILD deleted file mode 100644 index 6885cad..0000000 --- a/testcorpus/git-submodules/PKGBUILD +++ /dev/null @@ -1,15 +0,0 @@ -pkgbase=git-submodules -pkgver=r1.0 -pkgrel=1 -pkgdesc="synthetic fixture" -url="https://example.invalid/git-submodules" -license=(MIT) -arch=(x86_64) -source=("git+file://@UPSTREAM_DIR@") -sha256sums=("SKIP") -build() { - echo building git-submodules -} -package_git-submodules() { - echo packaging git-submodules -} diff --git a/testcorpus/git-submodules/manifest.json b/testcorpus/git-submodules/manifest.json deleted file mode 100644 index 6fd894a..0000000 --- a/testcorpus/git-submodules/manifest.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "git-submodules", - "build": "succeed", - "sig": true, - "packages": [], - "installed": [ - { - "name": "glibc", - "version": "2.39-1", - "arch": "x86_64" - }, - { - "name": "pacman", - "version": "6.1.0-1", - "arch": "x86_64" - }, - { - "name": "binutils", - "version": "2.42-1", - "arch": "x86_64" - } - ], - "log_lines": [ - "==> Making package.", - "==> Entering fakeroot environment." - ], - "vercheck": "r1.0-1" -} |
