mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 01:38:04 +00:00
Merge pull request #3390 from sylvestre/mv-test
mv: move the tests in a separate function
This commit is contained in:
commit
5c3580fb04
1 changed files with 23 additions and 13 deletions
|
@ -748,19 +748,6 @@ fn test_mv_errors() {
|
|||
.fails()
|
||||
.stderr_str()
|
||||
.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]
|
||||
|
@ -813,6 +800,29 @@ fn test_mv_permission_error() {
|
|||
.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:
|
||||
|
||||
// $ at.touch a b
|
||||
|
|
Loading…
Reference in a new issue