#![cfg(test)] pub mod data; mod mock_client; mod mock_ids; pub use mock_client::MockClient; use std::{fmt, io::Write}; use tempfile::NamedTempFile; #[allow(clippy::needless_pass_by_value)] pub fn check_trait(actual: A, expected: E, tr: &str, ty: &str) where A: fmt::Debug + PartialEq, E: fmt::Debug, { assert_eq!( actual, expected, "`impl {tr} for {ty}` expected: {expected:?}, actual: {actual:?}", ); } /// Helper to create a temp file from `data` pub fn create_file(data: &[u8]) -> NamedTempFile { let mut tmp = NamedTempFile::new().expect("creating temp file"); tmp.write_all(data).expect("writing to tempfile"); tmp }