File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 88// libstd ignores SIGPIPE, and other libraries may set signal masks.
99// Make sure that these behaviors don't get inherited to children
1010// spawned via std::process, since they're needed for traditional UNIX
11- // filter behavior. This test checks that `yes | head` terminates
11+ // filter behavior.
12+ // This test checks that `while echo y ; do : ; done | head` terminates
1213// (instead of running forever), and that it does not print an error
1314// message about a broken pipe.
1415
1516// ignore-emscripten no threads support
1617// ignore-vxworks no 'sh'
1718// ignore-fuchsia no 'sh'
18- // ignore-nto no 'yes'
1919
2020use std:: process;
2121use std:: thread;
@@ -27,7 +27,11 @@ fn main() {
2727 thread:: sleep_ms ( 5000 ) ;
2828 process:: exit ( 1 ) ;
2929 } ) ;
30- let output = process:: Command :: new ( "sh" ) . arg ( "-c" ) . arg ( "yes | head" ) . output ( ) . unwrap ( ) ;
30+ let output = process:: Command :: new ( "sh" )
31+ . arg ( "-c" )
32+ . arg ( "while echo y ; do : ; done | head" )
33+ . output ( )
34+ . unwrap ( ) ;
3135 assert ! ( output. status. success( ) ) ;
3236 assert ! ( output. stderr. len( ) == 0 ) ;
3337}
You can’t perform that action at this time.
0 commit comments