mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-18 16:43:21 +00:00
36 lines
728 B
Rust
36 lines
728 B
Rust
macro_rules! twoway {
|
|
(
|
|
$(
|
|
|
|
// 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);
|
|
}
|
|
)*
|
|
};
|
|
}
|
|
|
|
twoway![
|
|
simple,
|
|
comments,
|
|
attributes,
|
|
manual_props,
|
|
complex,
|
|
tiny,
|
|
tinynoopt,
|
|
long,
|
|
key,
|
|
multirsx,
|
|
commentshard,
|
|
emoji
|
|
];
|