2024-01-03 01:52:18 +00:00
|
|
|
macro_rules! pass {
|
|
|
|
($id:ident) => {
|
|
|
|
#[test]
|
|
|
|
fn $id() {
|
|
|
|
trybuild::TestCases::new().pass(format!("tests/sources/{}.rs", stringify!($id)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! fail {
|
|
|
|
($id:ident) => {
|
|
|
|
#[test]
|
|
|
|
fn $id() {
|
|
|
|
trybuild::TestCases::new().compile_fail(format!("tests/sources/{}.rs", stringify!($id)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-03 03:04:57 +00:00
|
|
|
pass!(chain_single_down);
|
|
|
|
pass!(chain_single_up);
|
2024-01-03 01:52:18 +00:00
|
|
|
pass!(empty);
|
2024-01-04 14:30:38 +00:00
|
|
|
pass!(example_patchedporobot);
|
2024-01-03 03:04:57 +00:00
|
|
|
pass!(from_single_custom);
|
|
|
|
pass!(parse_single_custom);
|
|
|
|
pass!(parse_single_i64);
|
|
|
|
pass!(parse_single_pathbuf);
|
|
|
|
pass!(parse_single_u64);
|
2024-01-04 14:30:38 +00:00
|
|
|
pass!(parse_single_u64_optional);
|
2024-01-03 01:55:29 +00:00
|
|
|
pass!(string_multi_explicit);
|
2024-01-03 01:56:28 +00:00
|
|
|
pass!(string_multi_implicit);
|
|
|
|
pass!(string_multi_mixed);
|
2024-01-03 03:04:57 +00:00
|
|
|
pass!(string_single_explicit);
|
2024-01-04 14:30:38 +00:00
|
|
|
pass!(string_single_expliciter);
|
2024-01-03 03:04:57 +00:00
|
|
|
pass!(string_single_implicit);
|
|
|
|
pass!(tryfrom_single_custom);
|
|
|
|
|
|
|
|
fail!(wrong_conversion_longfatarrow);
|
|
|
|
fail!(wrong_conversion_longthinarrow);
|
|
|
|
fail!(wrong_conversion_tildearrow);
|
|
|
|
fail!(wrong_conversion_trait_from);
|
|
|
|
fail!(wrong_conversion_trait_fromstr);
|
|
|
|
fail!(wrong_conversion_trait_tryfrom);
|
|
|
|
fail!(wrong_nonsense_1);
|
|
|
|
fail!(wrong_nonsense_2);
|
|
|
|
fail!(wrong_nonsense_3);
|
|
|
|
fail!(wrong_start);
|
|
|
|
fail!(wrong_syntax_colon);
|
|
|
|
fail!(wrong_syntax_type);
|
|
|
|
fail!(wrong_unqualified_import);
|
|
|
|
fail!(wrong_unqualified_noimport);
|