Clean tests
This commit is contained in:
@@ -71,13 +71,12 @@ fn test_generated_code_builds() {
|
|||||||
all_code.push_str(&content);
|
all_code.push_str(&content);
|
||||||
all_code.push_str("\n");
|
all_code.push_str("\n");
|
||||||
}
|
}
|
||||||
let final_code = all_code.replace("use crate::", "use roto::");
|
|
||||||
let lib_path = temp_project_dir.join("src/lib.rs");
|
let lib_path = temp_project_dir.join("src/lib.rs");
|
||||||
fs::write(lib_path, final_code).expect("Failed to write generated code to src/lib.rs");
|
fs::write(lib_path, all_code).expect("Failed to write generated code to src/lib.rs");
|
||||||
|
|
||||||
// 5. Attempt to build the project
|
// 5. Attempt to build the project
|
||||||
let build_status = Command::new("cargo")
|
let build_status = Command::new("cargo")
|
||||||
.args(["build"])
|
.args(["--offline", "build"])
|
||||||
.current_dir(&temp_project_dir)
|
.current_dir(&temp_project_dir)
|
||||||
.status()
|
.status()
|
||||||
.expect("Failed to run cargo build");
|
.expect("Failed to run cargo build");
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ fn test_types_generated_code_builds() {
|
|||||||
|
|
||||||
// 5. Attempt to build the project
|
// 5. Attempt to build the project
|
||||||
let build_status = Command::new("cargo")
|
let build_status = Command::new("cargo")
|
||||||
.args(["build"])
|
.args(["--offline", "build"])
|
||||||
.current_dir(&temp_project_dir)
|
.current_dir(&temp_project_dir)
|
||||||
.status()
|
.status()
|
||||||
.expect("Failed to run cargo build");
|
.expect("Failed to run cargo build");
|
||||||
|
|||||||
Reference in New Issue
Block a user