samples.rs 728 B

123456789101112131415161718192021222324252627282930313233343536
  1. macro_rules! twoway {
  2. (
  3. $(
  4. // doc attrs
  5. $( #[doc = $doc:expr] )*
  6. $name:ident
  7. ),*
  8. ) => {
  9. $(
  10. $( #[doc = $doc] )*
  11. #[test]
  12. fn $name() {
  13. let src = include_str!(concat!("./samples/", stringify!($name), ".rsx"));
  14. let formatted = dioxus_autofmt::fmt_file(src);
  15. let out = dioxus_autofmt::apply_formats(src, formatted);
  16. pretty_assertions::assert_eq!(&src, &out);
  17. }
  18. )*
  19. };
  20. }
  21. twoway![
  22. simple,
  23. comments,
  24. attributes,
  25. manual_props,
  26. complex,
  27. tiny,
  28. tinynoopt,
  29. long,
  30. key,
  31. multirsx,
  32. commentshard,
  33. emoji
  34. ];