Add tests for macro in pattern position

This commit is contained in:
Seiichi Uchida 2017-12-10 00:21:49 +09:00
parent 97fd517593
commit 0909ecbac7
2 changed files with 30 additions and 0 deletions

View File

@ -284,3 +284,19 @@ impl Foo {
/// foo
pub fn foo(&self) -> Bar<foo!( )> {}
}
// #819
fn macro_in_pattern_position () {
let x = match y {
foo!( ) => (),
bar!( a, b,
c) => (),
bar!(a
, b
, c
,) => (),
baz!( 1 + 2 + 3, quux.kaas( )
) => (),
quux!(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB) => (),
};
}

View File

@ -808,3 +808,17 @@ impl Foo {
/// foo
pub fn foo(&self) -> Bar<foo!()> {}
}
// #819
fn macro_in_pattern_position() {
let x = match y {
foo!() => (),
bar!(a, b, c) => (),
bar!(a, b, c,) => (),
baz!(1 + 2 + 3, quux.kaas()) => (),
quux!(
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
) => (),
};
}