fix: update tests with fail condition

This commit is contained in:
DecDuck
2026-03-02 22:31:37 +11:00
parent 10b66a9e32
commit e5fd8f8877
8 changed files with 9 additions and 11 deletions
+9 -11
View File
@@ -3,9 +3,7 @@ extern crate test_generator;
use std::path::Path; use std::path::Path;
use serde_json::json;
use test_generator::test_resources; use test_generator::test_resources;
use tokio::{fs::File, io::AsyncWriteExt};
use crate::manifest::generate_manifest_rusty; use crate::manifest::generate_manifest_rusty;
@@ -35,14 +33,14 @@ fn manifest_gen(resource: &str) {
) )
}); });
let mut output_path = filepath.to_path_buf(); let first_chunk = manifest
output_path.set_extension("json"); .chunks
.values()
let mut file = File::create(output_path) .next()
.await .expect("no chunks generated");
.expect("failed to open output path"); let first_chunk_length = first_chunk.files.len();
file.write_all(json!(manifest).to_string().as_bytes()) if first_chunk_length == 0 {
.await panic!("{} has no files in manifest", filepath.display());
.expect("failed to write output"); }
}); });
} }