1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge branch 'main' into truncate-no-such-dir

This commit is contained in:
Sylvestre Ledru 2022-01-29 09:58:17 +01:00 committed by GitHub
commit 57ee6b5302
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
114 changed files with 424 additions and 246 deletions

View file

@ -386,3 +386,15 @@ fn test_no_such_dir() {
.no_stdout()
.stderr_contains("cannot open 'a/b' for writing: No such file or directory");
}
/// Test that truncate with a relative size less than 0 is not an error.
#[test]
fn test_underflow_relative_size() {
let (at, mut ucmd) = at_and_ucmd!();
ucmd.args(&["-s-1", FILE1])
.succeeds()
.no_stdout()
.no_stderr();
assert!(at.file_exists(FILE1));
assert!(at.read_bytes(FILE1).is_empty());
}