use std::{
fs::{self, File},
path::Path,
};
mod absolute_path;
mod relative_path;
#[test]
fn trybuild() {
let t = trybuild::TestCases::new();
t.compile_fail("tests/trybuild/*.rs");
}
#[test]
fn macro_caching() {
let file: &Path = "tests/macro_caching/the_file.txt".as_ref();
let mut cargo_run = std::process::Command::new("cargo");
cargo_run
.arg("+nightly")
.arg("run")
.current_dir(fs::canonicalize(file.parent().unwrap()).unwrap());
File::create(file).unwrap();
assert!(cargo_run.status().unwrap().success());
fs::remove_file(file).unwrap();
assert!(!cargo_run.status().unwrap().success());
File::create(file).unwrap();
assert!(cargo_run.status().unwrap().success());
fs::remove_file(file).unwrap();
}