Fix cp bug (#5642)

This commit is contained in:
Kangaxx-0
2022-05-31 16:24:33 -07:00
committed by GitHub
parent 41853b9f18
commit ee8a0c9477
2 changed files with 29 additions and 3 deletions

View File

@ -318,3 +318,16 @@ fn copy_dir_symlink_file_body_not_changed() {
assert!(actual.contains("hello_data"));
});
}
#[test]
fn copy_identical_file() {
Playground::setup("cp_test_15", |_dirs, sandbox| {
sandbox.with_files(vec![EmptyFile("same.txt")]);
let actual = nu!(
cwd: sandbox.cwd(),
"cp same.txt same.txt",
);
assert!(actual.err.contains("Copy aborted"));
});
}