mod build_utils;
use build_utils::*;
#[test]
fn hotreload_works() -> std::io::Result<()> {
const PACKAGE_NAME: &str = "lib_bin_together";
let target_dir = copy_test_project(PACKAGE_NAME)?;
let target_lib = target_dir.as_ref().join("src").join("lib.rs");
let updated_lib = target_dir.as_ref().join("src").join("lib_updated.rs");
cargo_clean_rebuild_in(target_dir.as_ref(), PACKAGE_NAME, Profile::Dev)?;
let mut test_run_process = cargo_run_in(target_dir.as_ref(), "bin_together", Profile::Dev)?;
test_run_process.wait_for_input_from_stdout()?;
std::fs::copy(updated_lib, target_lib)?;
cargo_clean_rebuild_in(target_dir.as_ref(), PACKAGE_NAME, Profile::Dev)?;
test_run_process.send_enter_to_stdin()?;
test_run_process.wait_for_successful_exit()?;
Ok(())
}