Skip to content

Commit 6fe4514

Browse files
committed
install: test install file to directory containing directory with same name
1 parent 174ea1e commit 6fe4514

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/by-util/test_install.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,3 +1764,18 @@ fn test_install_from_stdin() {
17641764
assert!(at.file_exists(target));
17651765
assert_eq!(at.read(target), test_string);
17661766
}
1767+
1768+
#[test]
1769+
fn test_install_failing_copy_file_to_target_contain_subdir_with_same_name() {
1770+
let (at, mut ucmd) = at_and_ucmd!();
1771+
let file = "file";
1772+
let dir1 = "dir1";
1773+
1774+
at.touch(file);
1775+
at.mkdir(dir1);
1776+
at.mkdir(format!("{}/{}", dir1, file));
1777+
ucmd.arg(file)
1778+
.arg(dir1)
1779+
.fails()
1780+
.stderr_contains("cannot overwrite directory");
1781+
}

0 commit comments

Comments
 (0)