Add UI test

This commit is contained in:
bwmf2 2023-02-28 06:05:45 +01:00
parent cdeb0e3e02
commit 219195fc4c
1 changed files with 24 additions and 0 deletions

View File

@ -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 }"
);
}