commit 62b33385d9444a44bfbcd18bcf4661d919385c77
parent f515fb8e22d78fea59d7d8212ddf783dc0594315
Author: Zack Newman <zack@philomathiclife.com>
Date: Wed, 28 Jan 2026 20:56:13 -0700
improve integration test. improve buffering strategy
Diffstat:
4 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/README.md b/README.md
@@ -47,7 +47,7 @@ of lints).
[zack@laptop ~]$ rustc -V
rustc 1.93.0 (254b59607 2026-01-19)
[zack@laptop ~]$ lints version
-lints 0.1.0
+lints 0.2.0
[zack@laptop ~]$ lints
deprecated-safe = { level = "deny", priority = -1 }
future-incompatible = { level = "deny", priority = -1 }
diff --git a/src/parse.rs b/src/parse.rs
@@ -68,7 +68,8 @@ pub(crate) enum E<'a> {
const START: &str = "name default meaning
---- ------- -------";
/// Lines between lints and lint groups.
-const MIDDLE: &str = "name sub-lints
+const MIDDLE: &str = "
+name sub-lints
---- ---------";
impl E<'_> {
/// Writes `self` into `stderr`.
diff --git a/src/rustc.rs b/src/rustc.rs
@@ -192,7 +192,11 @@ fn priv_sep_stdin() -> Result<(), E> {
pub(crate) fn execute(read_stdin: bool) -> Result<Vec<u8>, E> {
if read_stdin {
priv_sep_stdin().and_then(|()| {
- let mut output = Vec::with_capacity(0x8000);
+ #[cfg(target_pointer_width = "16")]
+ let cap = 0x2000;
+ #[cfg(not(target_pointer_width = "16"))]
+ let cap = 0x10000;
+ let mut output = Vec::with_capacity(cap);
io::stdin()
.lock()
.read_to_end(&mut output)
diff --git a/tests/parse_1_93_0.rs b/tests/parse_1_93_0.rs
@@ -6,7 +6,6 @@ use std::{
env,
io::Write as _,
process::{Command, Stdio},
- thread,
};
#[expect(clippy::too_many_lines, reason = "rustc -Whelp output is large")]
#[expect(clippy::tests_outside_test_module, reason = "false positive")]
@@ -335,16 +334,15 @@ variant-size-differences = { level = \"deny\", priority = -1 }
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.spawn()
- .is_ok_and(|mut child| child.stdin.take().is_some_and(|mut stdin| {
- let handle = thread::spawn(move || {
- assert!(stdin.write_all(RUSTC_1_93_0).is_ok_and(|()| true));
- });
- child.wait_with_output().is_ok_and(|output| {
- handle.is_finished()
- && output.status.code() == Some(0i32)
- && output.stderr.is_empty()
- && output.stdout == EXPECTED
- })
- }))
+ .is_ok_and(|mut child| child.stdin.take().is_some_and(|mut stdin| stdin
+ .write_all(RUSTC_1_93_0)
+ .is_ok_and(|()| {
+ drop(stdin);
+ child.wait_with_output().is_ok_and(|output| {
+ output.status.code() == Some(0i32)
+ && output.stderr.is_empty()
+ && output.stdout == EXPECTED
+ })
+ })))
);
}