test(run): compile the output counting reader only on Unix (#5407)

The Windows Clippy job fails because the test reader `Counted` is compiled on Windows, where its only caller is excluded. The flooding-process test uses `awk` and already requires Unix. Apply the same condition to the reader and its `Read` implementation. The cross-platform queue shutdown test keeps its own reader.

Co-authored-by: faysou <893862+faysou@users.noreply.github.com>
This commit is contained in:
faysou
2026-11-23 20:01:20 +08:00
committed by GitHub
co-authored by faysou
parent 50cd478773
commit b501f51526
+2
View File
@@ -1587,11 +1587,13 @@ mod tests {
}
/// A pipe stand-in that counts the bytes taken from it.
#[cfg(unix)]
struct Counted<R> {
inner: R,
taken: Arc<AtomicUsize>,
}
#[cfg(unix)]
impl<R: Read> Read for Counted<R> {
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
let n = self.inner.read(buf)?;