1
Fork 0

add ui tests

This commit is contained in:
Mark Mansi 2019-05-22 12:20:43 -05:00
parent 3f2dd24adc
commit 5a9de557b3
4 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,9 @@
// Regression test for issue #61033.
macro_rules! test1 {
($x:ident, $($tt:tt)*) => { $($tt)+ } //~ERROR this must repeat at least once
}
fn main() {
test1!(x,);
}

View file

@ -0,0 +1,8 @@
error: this must repeat at least once
--> $DIR/issue-61033-1.rs:4:34
|
LL | ($x:ident, $($tt:tt)*) => { $($tt)+ }
| ^^^^^
error: aborting due to previous error

View file

@ -0,0 +1,19 @@
// Regression test for issue #61033.
macro_rules! test2 {
(
$(* $id1:ident)*
$(+ $id2:ident)*
) => {
$( //~ERROR meta-variable `id1` repeats 2 times
$id1 + $id2 // $id1 and $id2 may repeat different numbers of times
)*
}
}
fn main() {
test2! {
* a * b
+ a + b + c
}
}

View file

@ -0,0 +1,11 @@
error: meta-variable `id1` repeats 2 times, but `id2` repeats 3 times
--> $DIR/issue-61033-2.rs:8:10
|
LL | $(
| __________^
LL | | $id1 + $id2 // $id1 and $id2 may repeat different numbers of times
LL | | )*
| |_________^
error: aborting due to previous error