#![allow(clippy::tests_outside_test_module)]
macro_rules! env_map {
($($k:literal = $v:literal),* $(,)?) => {{
use ::std::{collections::HashMap, ffi::OsString};
#[allow(unused_mut)]
let mut map = HashMap::<OsString, OsString>::new();
$(
map.insert(OsString::from($k), OsString::from($v));
)*
map
}}
}
macro_rules! expect_msg {
() => {
"should be able to parse from environment variables"
};
}
macro_rules! make_snapshot_test {
($t:ident, $env:expr $(,)?) => {{
let x = $t::try_from($env);
::insta::with_settings!({
omit_expression => true,
}, {
::insta::assert_debug_snapshot!(x);
});
x.expect(expect_msg!());
}}
}
mod default_fromstr_i32;
mod from_pathbuf;
mod fromstr_i32;
mod intostring;
mod many_fields;
mod option_fromstr_i32;
#[test]
fn macros() {
let t = trybuild::TestCases::new();
t.pass("tests/integrations/macros/pass/*.rs");
t.compile_fail("tests/integrations/macros/compile_fail/*.rs");
}