1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-16 19:56:17 +00:00

Merge pull request #2943 from jfinkels/truncate-no-such-dir

truncate: better error msg when dir does not exist
This commit is contained in:
Sylvestre Ledru 2022-01-29 12:25:38 +01:00 committed by GitHub
commit 1dcd3b2c24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View file

@ -378,6 +378,15 @@ fn test_division_by_zero_reference_and_size() {
.stderr_contains("division by zero");
}
#[test]
fn test_no_such_dir() {
new_ucmd!()
.args(&["-s", "0", "a/b"])
.fails()
.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() {