File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -144,14 +144,9 @@ fn json_input() {
144
144
145
145
#[ test]
146
146
fn json_output_json_input ( ) {
147
- #![ allow(
148
- clippy:: zombie_processes,
149
- reason = "can't wait without violating borrow rule"
150
- ) ]
151
-
152
147
let workspace = SampleWorkspace :: default ( ) ;
153
148
154
- let json_output = Command :: new ( PDU )
149
+ let mut json_output = Command :: new ( PDU )
155
150
. with_current_dir ( & workspace)
156
151
. with_arg ( "--json-output" )
157
152
. with_arg ( "--quantity=apparent-size" )
@@ -170,6 +165,7 @@ fn json_output_json_input() {
170
165
. with_stdin (
171
166
json_output
172
167
. stdout
168
+ . take ( )
173
169
. expect ( "get stdout of command with --json-output" )
174
170
. into ( ) ,
175
171
)
@@ -196,4 +192,9 @@ fn json_output_json_input() {
196
192
eprintln ! ( "EXPECTED:\n {expected}\n " ) ;
197
193
198
194
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( ) ) ;
199
200
}
You can’t perform that action at this time.
0 commit comments