samples.rs 864 B

1234567891011121314151617181920212223242526272829303132333435
  1. macro_rules! twoway {
  2. ($val:literal => $name:ident) => {
  3. #[test]
  4. fn $name() {
  5. let src = include_str!(concat!("./samples/", $val, ".rsx"));
  6. let formatted = dioxus_autofmt::fmt_file(src);
  7. let out = dioxus_autofmt::apply_formats(src, formatted);
  8. pretty_assertions::assert_eq!(&src, &out);
  9. }
  10. };
  11. }
  12. twoway! ("simple" => simple);
  13. twoway! ("comments" => comments);
  14. twoway! ("attributes" => attributes);
  15. twoway! ("manual_props" => manual_props);
  16. twoway! ("complex" => complex);
  17. twoway! ("tiny" => tiny);
  18. twoway! ("tinynoopt" => tinynoopt);
  19. twoway! ("long" => long);
  20. twoway! ("key" => key);
  21. // Disabled because we can't handle comments on exprs yet
  22. twoway! ("multirsx" => multirsx);
  23. // Disabled because we can't handle comments on exprs yet
  24. twoway! ("commentshard" => commentshard);