mirror of
https://github.com/uutils/coreutils
synced 2024-12-17 00:23:18 +00:00
Bare minimum functionality of `install file dir` implemented. Also added TODO markers in code for outstanding parameters and split main function into smaller logical chunks.
38 lines
857 B
Rust
38 lines
857 B
Rust
extern crate libc;
|
|
extern crate time;
|
|
extern crate kernel32;
|
|
extern crate winapi;
|
|
extern crate filetime;
|
|
|
|
use self::filetime::*;
|
|
use common::util::*;
|
|
|
|
static UTIL_NAME: &'static str = "install";
|
|
|
|
#[test]
|
|
fn test_install_help() {
|
|
let (at, mut ucmd) = testing(UTIL_NAME);
|
|
|
|
let result = ucmd.arg("--help").run();
|
|
assert_empty_stderr!(result);
|
|
assert!(result.success);
|
|
|
|
// assert!(result.stdout.contains("Usage:"));
|
|
}
|
|
|
|
#[test]
|
|
fn test_install_basic() {
|
|
let (at, mut ucmd) = testing(UTIL_NAME);
|
|
let dir = "test_install_target_dir_dir";
|
|
let file = "test_install_target_dir_file_a";
|
|
|
|
at.touch(file);
|
|
at.mkdir(dir);
|
|
let result = ucmd.arg(file).arg(dir).run();
|
|
|
|
assert_empty_stderr!(result);
|
|
assert!(result.success);
|
|
|
|
assert!(!at.file_exists(file));
|
|
assert!(at.file_exists(&format!("{}/{}", dir, file)));
|
|
}
|