Skip to content

Commit d30e2d7

Browse files
committed
install: test install file to directory containing directory with same name
1 parent 73a8300 commit d30e2d7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/by-util/test_install.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,3 +1764,17 @@ 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_all(&format!("{dir1}/{file}"));
1776+
ucmd.arg(file)
1777+
.arg(dir1)
1778+
.fails()
1779+
.stderr_contains("cannot overwrite directory");
1780+
}

0 commit comments

Comments
 (0)