use assertables::*;
use std::path::PathBuf;
use std::process::Command;
use lazy_static::*;
#[path = "testing.rs"]
mod testing;
use testing::*;
lazy_static! {
pub static ref DIR = TESTS_DIR
.join("command")
.join("input");
}
#[test]
fn test_command_x_input() {
let input: PathBuf = DIR.join("example.md");
let actual: PathBuf = DIR.join("example.html");
let expect: PathBuf = DIR.join("example.html=expect.html");
assert!(input.exists(), "input path: {:?}", input);
assert!(expect.exists(), "expect path: {:?}", expect);
remove_file_if_exists(&actual).expect("remove");
assert!(!actual.exists(), "!actual.exists() path: {:?}", actual);
let _output = ::std::process::Command::new(&*COMMAND_OS)
.arg("--input")
.arg(input.as_os_str())
.output()
.expect("failure");
assert!(actual.exists(), "actual.exists() path: {:?}", actual);
assert_fn_ok_eq_other!(
::std::fs::read_to_string,
&actual,
&expect,
);
remove_file_if_exists(&actual).expect("remove");
}