@@ -137,27 +137,26 @@ fn test_readonly() {
137137#[ test]
138138#[ cfg( target_os = "linux" ) ]
139139fn test_tee_no_more_writeable_2 ( ) {
140- // should be equals to 'tee out1 out2 >/dev/full <multi_read' call
141- // but currently there is no way to redirect stdout to /dev/full
142- // so this test is disabled
143- let ( _at, mut ucmd) = at_and_ucmd ! ( ) ;
144- let _content = ( 1 ..=10 ) . fold ( String :: new ( ) , |mut output, x| {
140+ use std:: fs:: File ;
141+ let ( at, mut ucmd) = at_and_ucmd ! ( ) ;
142+ let content = ( 1 ..=10 ) . fold ( String :: new ( ) , |mut output, x| {
145143 let _ = writeln ! ( output, "{x}" ) ;
146144 output
147145 } ) ;
148146 let file_out_a = "tee_file_out_a" ;
149147 let file_out_b = "tee_file_out_b" ;
148+ let dev_full = File :: options ( ) . append ( true ) . open ( "/dev/full" ) . unwrap ( ) ;
150149
151- let _result = ucmd
150+ let result = ucmd
152151 . arg ( file_out_a)
153152 . arg ( file_out_b)
154- . pipe_in ( "/dev/full" )
155- . succeeds ( ) ; // TODO: expected to succeed currently; change to fails() when required
153+ . set_stdout ( dev_full)
154+ . pipe_in ( content. as_bytes ( ) )
155+ . fails ( ) ;
156156
157- // TODO: comment in after https://github.com/uutils/coreutils/issues/1805 is fixed
158- // assert_eq!(at.read(file_out_a), content);
159- // assert_eq!(at.read(file_out_b), content);
160- // assert!(result.stderr.contains("No space left on device"));
157+ assert_eq ! ( at. read( file_out_a) , content) ;
158+ assert_eq ! ( at. read( file_out_b) , content) ;
159+ assert ! ( result. stderr_str( ) . contains( "No space left on device" ) ) ;
161160}
162161
163162#[ cfg( target_os = "linux" ) ]
0 commit comments