mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 11:20:54 +00:00
move test
This commit is contained in:
parent
7d92b9f6ff
commit
8670e83cec
@ -1290,3 +1290,23 @@ const VALUE: (bool, bool) = (true , false );
|
|||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_vis() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
macro_rules! m {
|
||||||
|
($vis:vis $name:ident) => { $vis fn $name() {} }
|
||||||
|
}
|
||||||
|
m!(pub foo);
|
||||||
|
m!(foo);
|
||||||
|
"#,
|
||||||
|
expect![[r#"
|
||||||
|
macro_rules! m {
|
||||||
|
($vis:vis $name:ident) => { $vis fn $name() {} }
|
||||||
|
}
|
||||||
|
pub fn foo() {}
|
||||||
|
fn foo() {}
|
||||||
|
"#]],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@ -101,20 +101,6 @@ fn test_attr_to_token_tree() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_vis() {
|
|
||||||
parse_macro(
|
|
||||||
r#"
|
|
||||||
macro_rules! foo {
|
|
||||||
($ vis:vis $ name:ident) => { $ vis fn $ name() {}};
|
|
||||||
}
|
|
||||||
"#,
|
|
||||||
)
|
|
||||||
.assert_expand_items(r#"foo!(pub foo);"#, r#"pub fn foo () {}"#)
|
|
||||||
// test optional cases
|
|
||||||
.assert_expand_items(r#"foo!(foo);"#, r#"fn foo () {}"#);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_inner_macro_rules() {
|
fn test_inner_macro_rules() {
|
||||||
parse_macro(
|
parse_macro(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user