2022-07-05 21:49:16 +00:00
|
|
|
macro_rules! twoway {
|
2023-01-13 00:29:31 +00:00
|
|
|
(
|
|
|
|
$(
|
|
|
|
|
|
|
|
// doc attrs
|
|
|
|
$( #[doc = $doc:expr] )*
|
|
|
|
$name:ident
|
|
|
|
),*
|
|
|
|
) => {
|
|
|
|
$(
|
|
|
|
$( #[doc = $doc] )*
|
|
|
|
#[test]
|
|
|
|
fn $name() {
|
|
|
|
let src = include_str!(concat!("./samples/", stringify!($name), ".rsx"));
|
|
|
|
let formatted = dioxus_autofmt::fmt_file(src);
|
|
|
|
let out = dioxus_autofmt::apply_formats(src, formatted);
|
|
|
|
pretty_assertions::assert_eq!(&src, &out);
|
|
|
|
}
|
|
|
|
)*
|
2022-07-05 21:49:16 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2023-01-13 00:29:31 +00:00
|
|
|
twoway![
|
|
|
|
simple,
|
|
|
|
comments,
|
|
|
|
attributes,
|
|
|
|
manual_props,
|
|
|
|
complex,
|
|
|
|
tiny,
|
|
|
|
tinynoopt,
|
|
|
|
long,
|
|
|
|
key,
|
|
|
|
multirsx,
|
|
|
|
commentshard,
|
2023-01-13 00:55:13 +00:00
|
|
|
emoji,
|
2023-01-13 01:02:41 +00:00
|
|
|
messy_indent,
|
2023-01-13 18:51:12 +00:00
|
|
|
long_exprs,
|
2023-01-14 00:46:34 +00:00
|
|
|
ifchain_forloop,
|
2023-01-14 01:16:06 +00:00
|
|
|
t2,
|
2023-01-17 00:36:50 +00:00
|
|
|
reallylong,
|
2023-01-17 01:25:55 +00:00
|
|
|
immediate_expr,
|
2023-01-18 00:24:29 +00:00
|
|
|
collapse_expr,
|
|
|
|
trailing_expr
|
2023-01-13 00:29:31 +00:00
|
|
|
];
|