mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
mv: move the tests in a separate function
This commit is contained in:
parent
0f59af22d5
commit
57b8caf1d0
1 changed files with 23 additions and 13 deletions
|
@ -748,19 +748,6 @@ fn test_mv_errors() {
|
||||||
.fails()
|
.fails()
|
||||||
.stderr_str()
|
.stderr_str()
|
||||||
.is_empty());
|
.is_empty());
|
||||||
|
|
||||||
// $ at.mkdir dir && at.touch file
|
|
||||||
// $ mv -i dir file
|
|
||||||
// err == mv: cannot overwrite non-directory 'file' with directory 'dir'
|
|
||||||
assert!(!scene
|
|
||||||
.ucmd()
|
|
||||||
.arg("-i")
|
|
||||||
.arg(dir)
|
|
||||||
.arg(file_a)
|
|
||||||
.pipe_in("y")
|
|
||||||
.fails()
|
|
||||||
.stderr_str()
|
|
||||||
.is_empty());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -813,6 +800,29 @@ fn test_mv_permission_error() {
|
||||||
.stderr_contains("Permission denied");
|
.stderr_contains("Permission denied");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_mv_interactive_error() {
|
||||||
|
let scene = TestScenario::new(util_name!());
|
||||||
|
let at = &scene.fixtures;
|
||||||
|
let dir = "test_mv_errors_dir";
|
||||||
|
let file_a = "test_mv_errors_file_a";
|
||||||
|
at.mkdir(dir);
|
||||||
|
at.touch(file_a);
|
||||||
|
|
||||||
|
// $ at.mkdir dir && at.touch file
|
||||||
|
// $ mv -i dir file
|
||||||
|
// err == mv: cannot overwrite non-directory 'file' with directory 'dir'
|
||||||
|
assert!(!scene
|
||||||
|
.ucmd()
|
||||||
|
.arg("-i")
|
||||||
|
.arg(dir)
|
||||||
|
.arg(file_a)
|
||||||
|
.pipe_in("y")
|
||||||
|
.fails()
|
||||||
|
.stderr_str()
|
||||||
|
.is_empty());
|
||||||
|
}
|
||||||
|
|
||||||
// Todo:
|
// Todo:
|
||||||
|
|
||||||
// $ at.touch a b
|
// $ at.touch a b
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue