Merge pull request #2244 from jfinkels/truncate-fix-round-up-character

truncate: fix character used to indicate round up
This commit is contained in:
Sylvestre Ledru
2021-05-22 14:03:59 +02:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -148,7 +148,7 @@ fn truncate(
'<' => TruncateMode::AtMost,
'>' => TruncateMode::AtLeast,
'/' => TruncateMode::RoundDown,
'*' => TruncateMode::RoundUp,
'%' => TruncateMode::RoundUp,
_ => TruncateMode::Absolute, /* assume that the size is just a number */
};
+1 -1
View File
@@ -206,7 +206,7 @@ fn test_round_up() {
let (at, mut ucmd) = at_and_ucmd!();
let mut file = at.make_file(TFILE2);
file.write_all(b"1234567890").unwrap();
ucmd.args(&["--size", "*4", TFILE2]).succeeds();
ucmd.args(&["--size", "%4", TFILE2]).succeeds();
file.seek(SeekFrom::End(0)).unwrap();
let actual = file.seek(SeekFrom::Current(0)).unwrap();
assert!(