dioxus/packages/autofmt/tests/samples.rs
2023-01-07 14:09:32 -08:00

35 lines
864 B
Rust

macro_rules! twoway {
($val:literal => $name:ident) => {
#[test]
fn $name() {
let src = include_str!(concat!("./samples/", $val, ".rsx"));
let formatted = dioxus_autofmt::fmt_file(src);
let out = dioxus_autofmt::apply_formats(src, formatted);
pretty_assertions::assert_eq!(&src, &out);
}
};
}
twoway! ("simple" => simple);
twoway! ("comments" => comments);
twoway! ("attributes" => attributes);
twoway! ("manual_props" => manual_props);
twoway! ("complex" => complex);
twoway! ("tiny" => tiny);
twoway! ("tinynoopt" => tinynoopt);
twoway! ("long" => long);
twoway! ("key" => key);
// Disabled because we can't handle comments on exprs yet
twoway! ("multirsx" => multirsx);
// Disabled because we can't handle comments on exprs yet
twoway! ("commentshard" => commentshard);