File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -727,3 +727,18 @@ fn test_read_error() {
727727 . fails ( )
728728 . stderr_contains ( "comm: /proc/self/mem: Input/output error" ) ;
729729}
730+
731+ #[ test]
732+ #[ cfg( unix) ]
733+ fn test_comm_write_error_dev_full ( ) {
734+ use std:: fs:: OpenOptions ;
735+ let scene = TestScenario :: new ( util_name ! ( ) ) ;
736+ scene. fixtures . write ( "a" , "a\n " ) ;
737+ let dev_full = OpenOptions :: new ( ) . write ( true ) . open ( "/dev/full" ) . unwrap ( ) ;
738+ scene
739+ . ucmd ( )
740+ . args ( & [ "a" , "a" ] )
741+ . set_stdout ( dev_full)
742+ . fails ( )
743+ . stderr_contains ( "No space left on device" ) ;
744+ }
Original file line number Diff line number Diff line change @@ -2066,3 +2066,15 @@ fn test_percent_percent_not_replaced() {
20662066 . stdout_is ( expected) ;
20672067 }
20682068}
2069+
2070+ #[ test]
2071+ #[ cfg( unix) ]
2072+ fn test_date_write_error_dev_full ( ) {
2073+ use std:: fs:: OpenOptions ;
2074+ let dev_full = OpenOptions :: new ( ) . write ( true ) . open ( "/dev/full" ) . unwrap ( ) ;
2075+ new_ucmd ! ( )
2076+ . arg ( "+%s" )
2077+ . set_stdout ( dev_full)
2078+ . fails ( )
2079+ . stderr_contains ( "write error" ) ;
2080+ }
Original file line number Diff line number Diff line change @@ -87,3 +87,11 @@ fn test_stdout_fail() {
8787 let status = proc. wait ( ) . unwrap ( ) ;
8888 assert_eq ! ( status. code( ) , Some ( 3 ) ) ;
8989}
90+
91+ #[ test]
92+ #[ cfg( unix) ]
93+ fn test_version_pipe_no_stderr ( ) {
94+ let mut child = new_ucmd ! ( ) . arg ( "--version" ) . run_no_wait ( ) ;
95+ child. close_stdout ( ) ;
96+ child. wait ( ) . unwrap ( ) . no_stderr ( ) ;
97+ }
You can’t perform that action at this time.
0 commit comments