diff options
author | n4n5 <its.just.n4n5@gmail.com> | 2024-06-30 19:00:54 +0200 |
---|---|---|
committer | n4n5 <its.just.n4n5@gmail.com> | 2024-06-30 19:00:54 +0200 |
commit | 635ad16c6338268258d43a40e2c19cec0917a28d (patch) | |
tree | 0bdf8e44677b8b2595014cee4b44ef3bc867018b /tests/by-util | |
parent | 371ba28db7b23de387c70a578ed4bef8bfffb0f4 (diff) |
touch: change message when trailing slash
Diffstat (limited to 'tests/by-util')
-rw-r--r-- | tests/by-util/test_touch.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/by-util/test_touch.rs b/tests/by-util/test_touch.rs index 44a198452..51731b9ff 100644 --- a/tests/by-util/test_touch.rs +++ b/tests/by-util/test_touch.rs @@ -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] |