Files
dioxus/packages/autofmt/tests/sample.rs
T
Jon Kelley 3a30b36f68 fix: some edge cases around autoformatting (#485)
* wip: remove comment support from autofmt

* fix: some edge cases around autoformatting

* fix: revert readme

* fix: failing test
2022-07-04 21:11:03 -04:00

26 lines
512 B
Rust

#![allow(unused)]
const SRC: &str = include_str!("./samples/all.rsx");
fn body() -> &'static str {
&SRC[6..SRC.len() - 3]
}
fn unindented_body() -> String {
body()
.lines()
.map(|line| match line.strip_prefix(" ") {
Some(line) => line,
None => line,
})
.collect::<Vec<_>>()
.join("\n")
}
#[test]
fn way_and_back() {
let blocks = dioxus_autofmt::fmt_file(SRC).into_iter().next().unwrap();
println!("{}", blocks.formatted);
}