mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-22 20:03:37 +00:00
move test
This commit is contained in:
parent
e838da18a9
commit
de136a5340
@ -595,3 +595,23 @@ fn bar() {}
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_macro_def_rules() {
|
||||
cov_mark::check!(parse_macro_def_rules);
|
||||
|
||||
check(
|
||||
r#"
|
||||
macro m {
|
||||
($id:ident) => { fn $id() {} }
|
||||
}
|
||||
m!(bar);
|
||||
"#,
|
||||
expect![[r#"
|
||||
macro m {
|
||||
($id:ident) => { fn $id() {} }
|
||||
}
|
||||
fn bar() {}
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
@ -77,12 +77,6 @@ fn to_subtree(tt: &tt::TokenTree) -> &tt::Subtree {
|
||||
}
|
||||
unreachable!("It is not a subtree");
|
||||
}
|
||||
fn to_literal(tt: &tt::TokenTree) -> &tt::Literal {
|
||||
if let tt::TokenTree::Leaf(tt::Leaf::Literal(lit)) = tt {
|
||||
return lit;
|
||||
}
|
||||
unreachable!("It is not a literal");
|
||||
}
|
||||
|
||||
fn to_punct(tt: &tt::TokenTree) -> &tt::Punct {
|
||||
if let tt::TokenTree::Leaf(tt::Leaf::Punct(lit)) = tt {
|
||||
@ -107,22 +101,6 @@ fn test_attr_to_token_tree() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_macro_def_rules() {
|
||||
cov_mark::check!(parse_macro_def_rules);
|
||||
|
||||
parse_macro2(
|
||||
r#"
|
||||
macro foo {
|
||||
($id:ident) => {
|
||||
fn $id() {}
|
||||
}
|
||||
}
|
||||
"#,
|
||||
)
|
||||
.assert_expand_items("foo!(bar);", "fn bar () {}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_macro_2_0_panic_2015() {
|
||||
parse_macro2(
|
||||
|
Loading…
Reference in New Issue
Block a user