mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
move test
This commit is contained in:
parent
0dd1b35479
commit
75b0ce17cf
@ -98,3 +98,29 @@ struct Baz;
|
|||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn tries_all_branches_matching_ident() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
macro_rules! m {
|
||||||
|
($ i:ident) => ( mod $ i {} );
|
||||||
|
(spam $ i:ident) => ( fn $ i() {} );
|
||||||
|
(eggs $ i:ident) => ( struct $ i; )
|
||||||
|
}
|
||||||
|
m! { foo }
|
||||||
|
m! { spam bar }
|
||||||
|
m! { eggs Baz }
|
||||||
|
"#,
|
||||||
|
expect![[r#"
|
||||||
|
macro_rules! m {
|
||||||
|
($ i:ident) => ( mod $ i {} );
|
||||||
|
(spam $ i:ident) => ( fn $ i() {} );
|
||||||
|
(eggs $ i:ident) => ( struct $ i; )
|
||||||
|
}
|
||||||
|
mod foo {}
|
||||||
|
fn bar() {}
|
||||||
|
struct Baz;
|
||||||
|
"#]],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@ -209,28 +209,6 @@ fn test_expr_order() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_fail_match_pattern_by_word_token() {
|
|
||||||
parse_macro(
|
|
||||||
r#"
|
|
||||||
macro_rules! foo {
|
|
||||||
($ i:ident) => (
|
|
||||||
mod $ i {}
|
|
||||||
);
|
|
||||||
(spam $ i:ident) => (
|
|
||||||
fn $ i() {}
|
|
||||||
);
|
|
||||||
(eggs $ i:ident) => (
|
|
||||||
struct $ i;
|
|
||||||
)
|
|
||||||
}
|
|
||||||
"#,
|
|
||||||
)
|
|
||||||
.assert_expand_items("foo! { foo }", "mod foo {}")
|
|
||||||
.assert_expand_items("foo! { spam bar }", "fn bar () {}")
|
|
||||||
.assert_expand_items("foo! { eggs Baz }", "struct Baz ;");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_match_group_pattern_by_separator_token() {
|
fn test_match_group_pattern_by_separator_token() {
|
||||||
parse_macro(
|
parse_macro(
|
||||||
|
Loading…
Reference in New Issue
Block a user