2022-07-05 21:49:16 +00:00
|
|
|
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);
|
2022-09-28 23:47:10 +00:00
|
|
|
|
|
|
|
twoway! ("long" => long);
|
2022-09-29 00:06:11 +00:00
|
|
|
|
|
|
|
twoway! ("key" => key);
|
2022-09-30 17:51:53 +00:00
|
|
|
|
|
|
|
// Disabled because we can't handle comments on exprs yet
|
|
|
|
twoway! ("multirsx" => multirsx);
|