fix: update tests with fail condition
This commit is contained in:
@@ -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");
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user