mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2026-01-15 17:51:07 +00:00
commit
ea5d67f8dc
5 changed files with 120 additions and 0 deletions
1
test/fixtures/mv/hello_world.txt
vendored
Normal file
1
test/fixtures/mv/hello_world.txt
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
Hello, World!
|
||||
24
test/mv.rs
Normal file
24
test/mv.rs
Normal 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);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue