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:
commit
1dcd3b2c24
2 changed files with 18 additions and 3 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue