Skip to content

Commit 1530e7f

Browse files
committed
lint: fix clippy
1 parent af897e2 commit 1530e7f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/json.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,9 @@ fn json_input() {
144144

145145
#[test]
146146
fn json_output_json_input() {
147-
#![allow(
148-
clippy::zombie_processes,
149-
reason = "can't wait without violating borrow rule"
150-
)]
151-
152147
let workspace = SampleWorkspace::default();
153148

154-
let json_output = Command::new(PDU)
149+
let mut json_output = Command::new(PDU)
155150
.with_current_dir(&workspace)
156151
.with_arg("--json-output")
157152
.with_arg("--quantity=apparent-size")
@@ -170,6 +165,7 @@ fn json_output_json_input() {
170165
.with_stdin(
171166
json_output
172167
.stdout
168+
.take()
173169
.expect("get stdout of command with --json-output")
174170
.into(),
175171
)
@@ -196,4 +192,9 @@ fn json_output_json_input() {
196192
eprintln!("EXPECTED:\n{expected}\n");
197193

198194
assert_eq!(actual, expected);
195+
196+
let json_output_status = json_output
197+
.wait()
198+
.expect("wait for the command with --json-output to terminate");
199+
assert!(json_output_status.success());
199200
}

0 commit comments

Comments
 (0)