mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-15 19:36:16 +00:00
Merge pull request #4769 from sylvestre/touch
touch: improve support for dangling link
This commit is contained in:
commit
6115af6386
3 changed files with 50 additions and 10 deletions
|
@ -829,3 +829,27 @@ fn test_touch_trailing_slash_no_create() {
|
|||
at.relative_symlink_dir("dir2", "link2");
|
||||
ucmd.args(&["-c", "link2/"]).succeeds();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_touch_no_dereference_ref_dangling() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
at.touch("file");
|
||||
at.relative_symlink_file("nowhere", "dangling");
|
||||
|
||||
ucmd.args(&["-h", "-r", "dangling", "file"]).succeeds();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_touch_no_dereference_dangling() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
at.relative_symlink_file("nowhere", "dangling");
|
||||
|
||||
ucmd.args(&["-h", "dangling"]).succeeds();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_touch_dash() {
|
||||
let (_, mut ucmd) = at_and_ucmd!();
|
||||
|
||||
ucmd.args(&["-h", "-"]).succeeds().no_stderr().no_stdout();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue