mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
add block matcher
This commit is contained in:
parent
8092b6487f
commit
762819864f
6 changed files with 64 additions and 0 deletions
|
@ -743,4 +743,23 @@ MACRO_ITEMS@[0; 40)
|
|||
);
|
||||
assert_expansion(&rules, "foo! { { 1; } }", "fn foo () {1 ;}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_meta() {
|
||||
let rules = create_rules(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
($ i:meta) => (
|
||||
#[$ i]
|
||||
fn bar() {}
|
||||
)
|
||||
}
|
||||
"#,
|
||||
);
|
||||
assert_expansion(
|
||||
&rules,
|
||||
r#"foo! { cfg(target_os = "windows") }"#,
|
||||
r#"# [cfg (target_os = "windows")] fn bar () {}"#,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue