Skip to content

Commit b168bca

Browse files
authored
Merge pull request #234 from rustcoreutils/cleanups
plib/testing: cleanups
2 parents 32bd0e6 + f64906b commit b168bca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: plib/src/testing.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ fn run_test_base(cmd: &str, args: &Vec<String>, stdin_data: &[u8]) -> Output {
4949
.stdout(Stdio::piped())
5050
.stderr(Stdio::piped())
5151
.spawn()
52-
.expect("failed to spawn grep");
52+
.expect(format!("failed to spawn command {}", cmd).as_str());
5353

5454
// Separate the mutable borrow of stdin from the child process
5555
if let Some(mut stdin) = child.stdin.take() {
56-
let chunk_size = 1024; // Example chunk size, adjust as needed
56+
let chunk_size = 1024; // Arbitrary chunk size, adjust if needed
5757
for chunk in stdin_data.chunks(chunk_size) {
5858
// Write each chunk
5959
if let Err(e) = stdin.write_all(chunk) {
@@ -66,7 +66,7 @@ fn run_test_base(cmd: &str, args: &Vec<String>, stdin_data: &[u8]) -> Output {
6666
break;
6767
}
6868

69-
// Optional: Sleep briefly to avoid CPU spinning
69+
// Sleep briefly to avoid CPU spinning
7070
thread::sleep(Duration::from_millis(10));
7171
}
7272
// Explicitly drop stdin to close the pipe

0 commit comments

Comments
 (0)