mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 06:30:08 +02:00
Fix cp bug (#5462)
* Cleanup - remove old commented code * Force a / or \ to distinguish between folders and files for cp * Force a / or \ to distinguish between folders and files for cp * Remove unneeded code * Add cp test for checking copy to non existing directory * Fix warning in test
This commit is contained in:
committed by
GitHub
parent
aa88449f29
commit
2cc5952c37
@ -235,3 +235,17 @@ fn copy_file_and_dir_from_two_parents_up_using_multiple_dots_to_current_dir_recu
|
||||
assert!(files_exist_at(vec!["hello_there", "hello_again"], expected));
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn copy_to_non_existing_dir() {
|
||||
Playground::setup("cp_test_11", |_dirs, sandbox| {
|
||||
sandbox.with_files(vec![EmptyFile("empty_file")]);
|
||||
|
||||
let actual = nu!(
|
||||
cwd: sandbox.cwd(),
|
||||
"cp empty_file ~/not_a_dir/",
|
||||
);
|
||||
assert!(actual.err.contains("directory not found"));
|
||||
assert!(actual.err.contains("destination directory does not exist"));
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user