dioxus/packages/autofmt/tests/samples.rs

37 lines
728 B
Rust
Raw Normal View History

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);
}
)*
};
}
2023-01-13 00:29:31 +00:00
twoway![
simple,
comments,
attributes,
manual_props,
complex,
tiny,
tinynoopt,
long,
key,
multirsx,
commentshard,
emoji
];