samples.rs 865 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. messy_indent,
  35. long_exprs,
  36. ifchain_forloop,
  37. t2,
  38. reallylong,
  39. immediate_expr,
  40. collapse_expr,
  41. trailing_expr
  42. ];