File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 8
8
// libstd ignores SIGPIPE, and other libraries may set signal masks.
9
9
// Make sure that these behaviors don't get inherited to children
10
10
// 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
12
13
// (instead of running forever), and that it does not print an error
13
14
// message about a broken pipe.
14
15
15
16
// ignore-emscripten no threads support
16
17
// ignore-vxworks no 'sh'
17
18
// ignore-fuchsia no 'sh'
18
- // ignore-nto no 'yes'
19
19
20
20
use std:: process;
21
21
use std:: thread;
@@ -27,7 +27,11 @@ fn main() {
27
27
thread:: sleep_ms ( 5000 ) ;
28
28
process:: exit ( 1 ) ;
29
29
} ) ;
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 ( ) ;
31
35
assert ! ( output. status. success( ) ) ;
32
36
assert ! ( output. stderr. len( ) == 0 ) ;
33
37
}
You can’t perform that action at this time.
0 commit comments