1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-15 17:51:07 +00:00

Merge pull request #420 from skv-headless/move_util

move utility
This commit is contained in:
Alex Lyon 2014-10-19 11:50:15 -07:00
commit ea5d67f8dc
5 changed files with 120 additions and 0 deletions

1
test/fixtures/mv/hello_world.txt vendored Normal file
View file

@ -0,0 +1 @@
Hello, World!

24
test/mv.rs Normal file
View file

@ -0,0 +1,24 @@
use std::io::process::Command;
use std::io::fs::{PathExtensions};
static EXE: &'static str = "./mv";
static TEST_HELLO_WORLD_SOURCE: &'static str = "hello_world.txt";
static TEST_HELLO_WORLD_DEST: &'static str = "move_of_hello_world.txt";
#[test]
fn test_mv() {
let prog = Command::new(EXE)
.arg(TEST_HELLO_WORLD_SOURCE)
.arg(TEST_HELLO_WORLD_DEST)
.status();
let exit_success = prog.unwrap().success();
assert_eq!(exit_success, true);
let dest = Path::new(TEST_HELLO_WORLD_DEST);
assert!(dest.exists() == true);
let source = Path::new(TEST_HELLO_WORLD_SOURCE);
assert!(source.exists() == false);
}