fix: only apply comments if relevant

This commit is contained in:
Jonathan Kelley committed 2022-07-05 17:59:33 -04:00
1 parent fa9ebe17cc
commit 19e6e43358
6 files changed
+35 -1

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
macro_rules! twoway {
($val:literal => $name:ident) => {
#[test]
fn $name() {
let src_right = include_str!(concat!("./wrong/", $val, ".rsx"));
let src_wrong = include_str!(concat!("./wrong/", $val, ".wrong.rsx"));
let formatted = dioxus_autofmt::fmt_file(src_wrong);
let out = dioxus_autofmt::apply_formats(src_wrong, formatted);
pretty_assertions::assert_eq!(&src_right, &out);
}
};
}
twoway!("comments" => comments);