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() {
144144
145145#[ test]
146146fn 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}
You can’t perform that action at this time.
0 commit comments