1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 13:37:48 +00:00

Merge pull request #2339 from sylvestre/gnu-compat

Improve the gnu compat and use it for "touch"
This commit is contained in:
Sylvestre Ledru 2021-06-03 10:53:47 +02:00 committed by GitHub
commit 24032498ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 5 deletions

View file

@ -449,3 +449,20 @@ fn test_touch_mtime_dst_fails() {
ucmd.args(&["-m", "-t", &s, file]).fails();
}
}
#[test]
#[cfg(unix)]
fn test_touch_system_fails() {
let (_at, mut ucmd) = at_and_ucmd!();
let file = "/";
ucmd.args(&[file])
.fails()
.stderr_contains("setting times of '/'");
}
#[test]
fn test_touch_trailing_slash() {
let (_at, mut ucmd) = at_and_ucmd!();
let file = "no-file/";
ucmd.args(&[file]).fails();
}