Skip to content

Commit

Permalink
Add UI test
Browse files Browse the repository at this point in the history
  • Loading branch information
bwmf2 committed Mar 2, 2023
1 parent cdeb0e3 commit 219195f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/ui/macros/issue-98790.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// run-pass

macro_rules! stringify_item {
($item:item) => {
stringify!($item)
};
}

macro_rules! repro {
($expr:expr) => {
stringify_item! {
pub fn repro() -> bool {
$expr
}
}
};
}

fn main() {
assert_eq!(
repro!(match () { () => true } | true),
"pub fn repro() -> bool { (match () { () => true, }) | true }"
);
}

0 comments on commit 219195f

Please sign in to comment.