-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent rustfmt from touching inside
verus!{...}
Fixes #33
- Loading branch information
1 parent
9849171
commit e5d9e1d
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#[test] | ||
/// Regression test for https://github.com/verus-lang/verusfmt/issues/33 | ||
fn mod_macro_item_idempotent() { | ||
let file = r#" | ||
mod foo { | ||
verus! { | ||
bar! { | ||
baz | ||
} | ||
} | ||
} | ||
"#; | ||
let formatted1 = verusfmt::rustfmt(&verusfmt::parse_and_format(file).unwrap()).unwrap(); | ||
let formatted2 = verusfmt::rustfmt(&verusfmt::parse_and_format(&formatted1).unwrap()).unwrap(); | ||
assert_eq!(formatted1, formatted2); | ||
} |