mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 20:17:45 +00:00
Merge pull request #6506 from Its-Just-Nans/touch-directory
`touch`: change message when directory
This commit is contained in:
commit
9013265e47
2 changed files with 32 additions and 2 deletions
|
@ -689,10 +689,23 @@ fn test_touch_system_fails() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
fn test_touch_trailing_slash() {
|
||||
let (_at, mut ucmd) = at_and_ucmd!();
|
||||
let file = "no-file/";
|
||||
ucmd.args(&[file]).fails();
|
||||
ucmd.args(&[file]).fails().stderr_only(format!(
|
||||
"touch: cannot touch '{file}': No such file or directory\n"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(target_os = "windows")]
|
||||
fn test_touch_trailing_slash_windows() {
|
||||
let (_at, mut ucmd) = at_and_ucmd!();
|
||||
let file = "no-file/";
|
||||
ucmd.args(&[file]).fails().stderr_only(format!(
|
||||
"touch: cannot touch '{file}': The filename, directory name, or volume label syntax is incorrect.\n"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue