File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ pub fn uu_app() -> Command {
145145 . long ( options:: SIZE )
146146 . required_unless_present ( options:: REFERENCE )
147147 . help ( translate ! ( "truncate-help-size" ) )
148+ . allow_hyphen_values ( true )
148149 . value_name ( "SIZE" ) ,
149150 )
150151 . arg (
Original file line number Diff line number Diff line change @@ -386,6 +386,17 @@ fn test_underflow_relative_size() {
386386 assert ! ( at. read_bytes( FILE1 ) . is_empty( ) ) ;
387387}
388388
389+ #[ test]
390+ fn test_negative_size_with_space ( ) {
391+ let ( at, mut ucmd) = at_and_ucmd ! ( ) ;
392+ ucmd. args ( & [ "-s" , "-1" , FILE1 ] )
393+ . succeeds ( )
394+ . no_stdout ( )
395+ . no_stderr ( ) ;
396+ assert ! ( at. file_exists( FILE1 ) ) ;
397+ assert ! ( at. read_bytes( FILE1 ) . is_empty( ) ) ;
398+ }
399+
389400#[ cfg( not( windows) ) ]
390401#[ test]
391402fn test_fifo_error_size_only ( ) {
You can’t perform that action at this time.
0 commit comments