Update crate references in codegen tests

Update imports to use `roto_tonic` instead of `crate` for BufferPool
and StatusBody. Remove the broad replacement of `crate` with `roto`
and add error output to `test_map_build.rs`.
This commit is contained in:
2026-05-16 19:45:46 -07:00
parent 56fc787f7a
commit b11b068345
4 changed files with 19 additions and 19 deletions
+3 -3
View File
@@ -55,12 +55,12 @@ fn test_helloworld_generated_code_builds() {
// 4. Write the generated code to src/lib.rs
let mut all_code = String::new();
for (_, content) in generated_files {
all_code.push_str(&content);
let replaced = content.replace("use crate::{BufferPool, StatusBody};", "use roto_tonic::{BufferPool, StatusBody};");
all_code.push_str(&replaced);
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");
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
let build_status = Command::new("cargo")