Revert cp and mv back to last-known-good state (#6169)

This commit is contained in:
JT
2022-07-29 07:49:20 +12:00
committed by GitHub
parent c9d0003818
commit 10e463180e
4 changed files with 129 additions and 246 deletions

View File

@ -17,22 +17,6 @@ fn copies_a_file() {
});
}
#[test]
fn copies_multiple_files() {
Playground::setup("cp_test_1_1", |dirs, sandbox| {
sandbox
.with_files(vec![EmptyFile("a.txt"), EmptyFile("b.txt")])
.mkdir("dest");
nu!(
cwd: dirs.test(),
"cp a.txt b.txt dest",
);
assert!(dirs.test().join("dest/a.txt").exists());
assert!(dirs.test().join("dest/b.txt").exists());
});
}
#[test]
fn copies_the_file_inside_directory_if_path_to_copy_is_directory() {
Playground::setup("cp_test_2", |dirs, _| {

View File

@ -22,36 +22,6 @@ fn moves_a_file() {
})
}
#[test]
fn moves_multiple_files() {
Playground::setup("mv_test_1_1", |dirs, sandbox| {
sandbox
.mkdir("expected")
.with_files(vec![EmptyFile("andres.txt"), EmptyFile("yehuda.txt")])
.within("foo")
.with_files(vec![EmptyFile("bar.txt")]);
let original_1 = dirs.test().join("andres.txt");
let original_2 = dirs.test().join("yehuda.txt");
let original_3 = dirs.test().join("foo/bar.txt");
let expected_1 = dirs.test().join("expected/andres.txt");
let expected_2 = dirs.test().join("expected/yehuda.txt");
let expected_3 = dirs.test().join("expected/bar.txt");
nu!(
cwd: dirs.test(),
"mv andres.txt yehuda.txt foo/bar.txt expected"
);
assert!(!original_1.exists());
assert!(!original_2.exists());
assert!(!original_3.exists());
assert!(expected_1.exists());
assert!(expected_2.exists());
assert!(expected_3.exists());
})
}
#[test]
fn overwrites_if_moving_to_existing_file() {
Playground::setup("mv_test_2", |dirs, sandbox| {