[tests] Move era_dump tests to Rust

This commit is contained in:
Ming-Hung Tsai
2021-10-05 15:22:23 +08:00
parent f6eb5173c9
commit cbc3baba45
3 changed files with 149 additions and 17 deletions

View File

@@ -180,6 +180,32 @@ macro_rules! test_unreadable_input_file {
//------------------------------------------
// test invalid content
pub fn test_tiny_input_file<'a, P>() -> Result<()>
where
P: MetadataReader<'a>,
{
let mut td = TestDir::new()?;
let input = td.mk_path("meta.bin");
file_utils::create_sized_file(&input, 1024)?;
let wrapper = build_args_fn(P::arg_type())?;
wrapper(&mut td, input.as_ref(), &|args: &[&OsStr]| {
run_fail(P::cmd(args))?;
Ok(())
})
}
#[macro_export]
macro_rules! test_tiny_input_file {
($program: ident) => {
#[test]
fn tiny_input_file() -> Result<()> {
test_tiny_input_file::<$program>()
}
};
}
pub fn test_help_message_for_tiny_input_file<'a, P>() -> Result<()>
where
P: MetadataReader<'a>,