mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Add a test
This commit is contained in:
+22
@@ -57,6 +57,28 @@ fn test_mv_move_file_into_dir() {
|
||||
assert!(Path::new(&format!("{}/{}", dir, file)).is_file());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_mv_strip_slashes() {
|
||||
let dir = "test_mv_strip_slashes_dir";
|
||||
let file = "test_mv_strip_slashes_file";
|
||||
let mut source = file.to_owned();
|
||||
source.push_str("/");
|
||||
|
||||
mkdir(dir);
|
||||
touch(file);
|
||||
|
||||
let result = run(Command::new(PROGNAME).arg(&source).arg(dir));
|
||||
assert!(!result.success);
|
||||
|
||||
assert!(!Path::new(&format!("{}/{}", dir, file)).is_file());
|
||||
|
||||
let result = run(Command::new(PROGNAME).arg("--strip-trailing-slashes").arg(source).arg(dir));
|
||||
assert_empty_stderr!(result);
|
||||
assert!(result.success);
|
||||
|
||||
assert!(Path::new(&format!("{}/{}", dir, file)).is_file());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_mv_multiple_files() {
|
||||
let target_dir = "test_mv_multiple_files_dir";
|
||||
|
||||
Reference in New Issue
Block a user