coreutils/test/mv.rs

25 lines
717 B
Rust
Raw Normal View History

2014-10-19 17:39:27 +00:00
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);
}