Skip to content

Commit

Permalink
Add a regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybosamiya committed Dec 29, 2023
1 parent 13281b9 commit a1da3d8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/verus-consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1312,3 +1312,31 @@ exec static LAZY_X: Lazy<X> ensures LAZY_X.wf() { Lazy::<X>::new() }
} // verus!
"###);
}

#[test]
fn verus_requires_clauses_confusable_with_generics() {
// Regression test for https://github.com/jaybosamiya/verusfmt/issues/19
let file = r#"
verus! {
fn test()
requires i < 0, len > 0,
{
}
} // verus!
"#;

assert_snapshot!(parse_and_format(file).unwrap(), @r###"
verus! {
fn test()
requires
i < 0,
len > 0,
{
}
} // verus!
"###);
}

0 comments on commit a1da3d8

Please sign in to comment.