You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests/std_filter_tests/ contains 66 test functions across 13 files that
have not been compiled since 2025-10-26. They are tracked in git, they look
maintained, and they run nowhere.
Evidence
The directory is absent from the test-binary list:
$ cargo nextest list --list-type binaries-only | grep -i filter
$ # (no output)
There is no [[test]] stanza for it in Cargo.toml, no tests/std_filter_tests.rs
entry file, and no other file under tests/ declares those modules.
Root cause
Commit b2d46d6 ("Tightens lint policy, documents API, and hardens runtime
paths", #222, 2025-10-26) renamed the entry file into the directory it points at:
Two things broke at once, and neither produced a diagnostic:
The test binary disappeared. Cargo builds one integration-test binary per tests/*.rs. Moving the only top-level entry file into a subdirectory left
nothing for Cargo to build, so the suite stopped existing rather than
starting to fail.
Every #[path] prefix became wrong.mod.rs still declares its
submodules relative to the old location:
From inside tests/std_filter_tests/, that resolves to tests/std_filter_tests/std_filter_tests/collection_filters.rs, which does
not exist. Were the binary restored without fixing these, it would fail to
compile.
This is the failure mode where a rename is silently correct to the compiler
because the thing it broke is no longer built at all.
Coverage lost
File
Area
collection_filters.rs
collection filters
command_filters/grep_filter_tests.rs
grep filter
command_filters/shell_filter_tests.rs
shell filter
command_filters/windows_filter_tests.rs
Windows shell bypass, streaming, metacharacters
hash_filters.rs
hash filters
io_filters.rs
I/O filters
network_functions.rs
network functions
path_filters.rs
expanduser, realpath, relative_to, with_suffix
which_filter_tests.rs, which_filter_common.rs
which resolver
Some of this is covered elsewhere — expanduser has a BDD scenario, and the which resolver has stdlib_which_tests — but the overlap has not been
assessed. Assessing it is part of the work: restoring 66 tests that duplicate
existing coverage is not automatically worth it, and knowing which are unique is
the point.
Why it matters now
This surfaced while addressing a review finding on #505. Codex reported an
unannotated std::env::var_os("PATH") in tests/std_filter_tests/command_filters/windows_filter_tests.rs, reasoning that
"a Windows make lint compiles the module with -D warnings and rejects the
existing lookup". That reasoning is sound but the premise is not: no make lint compiles that file, on any platform, because Cargo never builds it. The
annotation added in #505 is correct in substance and harmless, but it does not
fix a live failure.
Related: #518 proposes Windows CI. That would not have caught this either — the
gap is Cargo target wiring, not platform coverage.
Suggested work
Restore the target: move mod.rs back to tests/std_filter_tests.rs, or add
an explicit [[test]] stanza with path.
Fix the #[path] prefixes, which are wrong under either arrangement.
Assess overlap with existing coverage before repairing each file. Delete what
is genuinely redundant rather than resurrecting it out of completeness.
Add a guard so this cannot recur silently. A test asserting the expected set
of test binaries, or a check that every tests/*/mod.rs has a corresponding
target, would have caught it the day it broke.
Acceptance criteria
cargo nextest list --list-type binaries-only includes the suite.
Every retained file compiles and passes.
Files whose coverage is genuinely duplicated elsewhere are deleted, with
the duplication named in the commit message.
A guard exists against an orphaned test tree recurring unnoticed.
Summary
tests/std_filter_tests/contains 66 test functions across 13 files thathave not been compiled since 2025-10-26. They are tracked in git, they look
maintained, and they run nowhere.
Evidence
The directory is absent from the test-binary list:
There is no
[[test]]stanza for it inCargo.toml, notests/std_filter_tests.rsentry file, and no other file under
tests/declares those modules.Root cause
Commit
b2d46d6("Tightens lint policy, documents API, and hardens runtimepaths", #222, 2025-10-26) renamed the entry file into the directory it points at:
Two things broke at once, and neither produced a diagnostic:
The test binary disappeared. Cargo builds one integration-test binary per
tests/*.rs. Moving the only top-level entry file into a subdirectory leftnothing for Cargo to build, so the suite stopped existing rather than
starting to fail.
Every
#[path]prefix became wrong.mod.rsstill declares itssubmodules relative to the old location:
From inside
tests/std_filter_tests/, that resolves totests/std_filter_tests/std_filter_tests/collection_filters.rs, which doesnot exist. Were the binary restored without fixing these, it would fail to
compile.
This is the failure mode where a rename is silently correct to the compiler
because the thing it broke is no longer built at all.
Coverage lost
collection_filters.rscommand_filters/grep_filter_tests.rsgrepfiltercommand_filters/shell_filter_tests.rsshellfiltercommand_filters/windows_filter_tests.rshash_filters.rsio_filters.rsnetwork_functions.rspath_filters.rsexpanduser,realpath,relative_to,with_suffixwhich_filter_tests.rs,which_filter_common.rswhichresolverSome of this is covered elsewhere —
expanduserhas a BDD scenario, and thewhichresolver hasstdlib_which_tests— but the overlap has not beenassessed. Assessing it is part of the work: restoring 66 tests that duplicate
existing coverage is not automatically worth it, and knowing which are unique is
the point.
Why it matters now
This surfaced while addressing a review finding on #505. Codex reported an
unannotated
std::env::var_os("PATH")intests/std_filter_tests/command_filters/windows_filter_tests.rs, reasoning that"a Windows
make lintcompiles the module with-D warningsand rejects theexisting lookup". That reasoning is sound but the premise is not: no
make lintcompiles that file, on any platform, because Cargo never builds it. Theannotation added in #505 is correct in substance and harmless, but it does not
fix a live failure.
Related: #518 proposes Windows CI. That would not have caught this either — the
gap is Cargo target wiring, not platform coverage.
Suggested work
mod.rsback totests/std_filter_tests.rs, or addan explicit
[[test]]stanza withpath.#[path]prefixes, which are wrong under either arrangement.that has moved considerably —
EnvLock,EnvVarGuard, thewhichresolverrefactor in Refactor which resolver: OS-specific workspace fallback #241, and the localization work in Externalize Fluent localization; Windows test context refactor + audit #260 all landed since.
is genuinely redundant rather than resurrecting it out of completeness.
of test binaries, or a check that every
tests/*/mod.rshas a correspondingtarget, would have caught it the day it broke.
Acceptance criteria
cargo nextest list --list-type binaries-onlyincludes the suite.the duplication named in the commit message.
#[expect(clippy::disallowed_methods)]added towindows_command_setupin Enforce the environment mandate with clippy disallowed-methods (#504) #505 is re-checked once the file is actuallycompiled.