File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-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,21 @@ use uutests::new_ucmd;
66#[ cfg( any( target_vendor = "apple" , target_os = "linux" ) ) ]
77use uutests:: { util:: TestScenario , util_name} ;
88
9+ #[ ignore = "does not work as same as users > /dev/full" ]
10+ #[ test]
11+ #[ cfg( target_os = "linux" ) ]
12+ fn test_full_panic ( ) {
13+ let full = std:: fs:: OpenOptions :: new ( )
14+ . write ( true )
15+ . open ( "/dev/full" )
16+ . unwrap ( ) ;
17+
18+ new_ucmd ! ( )
19+ . set_stdout ( full)
20+ . fails ( )
21+ . stderr_contains ( "No space" ) ;
22+ }
23+
924#[ test]
1025fn test_invalid_arg ( ) {
1126 new_ucmd ! ( ) . arg ( "--definitely-invalid" ) . fails_with_code ( 1 ) ;
You can’t perform that action at this time.
0 commit comments