File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 66// spell-checker:ignore (paths) wtmp
77
88use std:: ffi:: OsString ;
9+ use std:: io:: { Write , stdout} ;
910use std:: path:: Path ;
1011
1112use clap:: builder:: ValueParser ;
@@ -73,7 +74,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
7374
7475 if !users. is_empty ( ) {
7576 users. sort ( ) ;
76- println ! ( "{}" , users. join( " " ) ) ;
77+ writeln ! ( stdout ( ) . lock ( ) , "{}" , users. join( " " ) ) ? ;
7778 }
7879
7980 Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -6,6 +6,20 @@ use uutests::new_ucmd;
66#[ cfg( any( target_vendor = "apple" , target_os = "linux" ) ) ]
77use uutests:: { util:: TestScenario , util_name} ;
88
9+ #[ test]
10+ #[ cfg( target_os = "linux" ) ]
11+ fn test_full_panic ( ) {
12+ let full = std:: fs:: OpenOptions :: new ( )
13+ . write ( true )
14+ . open ( "/dev/full" )
15+ . unwrap ( ) ;
16+
17+ new_ucmd ! ( )
18+ . set_stdout ( full)
19+ . fails ( )
20+ . stderr_contains ( "No space" ) ;
21+ }
22+
923#[ test]
1024fn test_invalid_arg ( ) {
1125 new_ucmd ! ( ) . arg ( "--definitely-invalid" ) . fails_with_code ( 1 ) ;
You can’t perform that action at this time.
0 commit comments