fix emoji support in autofmt
This commit is contained in:
1 parent
fd4eac3488
commit
cc8b910cf3
4 files changed
+48
-36
No files matched your search
@@ -1,35 +1,36 @@
|
||||
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);
|
||||
}
|
||||
(
|
||||
$(
|
||||
|
||||
// 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" => 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);
|
||||
twoway![
|
||||
simple,
|
||||
comments,
|
||||
attributes,
|
||||
manual_props,
|
||||
complex,
|
||||
tiny,
|
||||
tinynoopt,
|
||||
long,
|
||||
key,
|
||||
multirsx,
|
||||
commentshard,
|
||||
emoji
|
||||
];
|
||||
@@ -0,0 +1,5 @@
|
||||
rsx! {
|
||||
div { class: "asdasdasd asdasdasd asdasdasd asdasdasd asdasdasd asdasdasd asdasdasd asdasdasd asdasdasd",
|
||||
section { "🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀" }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user