mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
install: improve error message (#7794)
* friendly message install file to directory containing directory with same name * install: test install file to directory containing directory with same name
This commit is contained in:
parent
f92ee6a519
commit
b009cae5a8
2 changed files with 24 additions and 0 deletions
|
@ -1764,3 +1764,17 @@ fn test_install_from_stdin() {
|
|||
assert!(at.file_exists(target));
|
||||
assert_eq!(at.read(target), test_string);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_install_failing_copy_file_to_target_contain_subdir_with_same_name() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
let file = "file";
|
||||
let dir1 = "dir1";
|
||||
|
||||
at.touch(file);
|
||||
at.mkdir_all(&format!("{dir1}/{file}"));
|
||||
ucmd.arg(file)
|
||||
.arg(dir1)
|
||||
.fails()
|
||||
.stderr_contains("cannot overwrite directory");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue