mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Convert doc comment to attr
This commit is contained in:
parent
11cc8024a1
commit
e7e896170a
2 changed files with 95 additions and 3 deletions
|
@ -867,6 +867,31 @@ fn test_meta() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_meta_doc_comments() {
|
||||
let rules = create_rules(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
($(#[$ i:meta])+) => (
|
||||
$(#[$ i])+
|
||||
fn bar() {}
|
||||
)
|
||||
}
|
||||
"#,
|
||||
);
|
||||
assert_expansion(
|
||||
MacroKind::Items,
|
||||
&rules,
|
||||
r#"foo! {
|
||||
/// Single Line Doc 1
|
||||
/**
|
||||
MultiLines Doc
|
||||
*/
|
||||
}"#,
|
||||
"# [doc = \" Single Line Doc 1\"] # [doc = \" \\n MultiLines Doc\\n \"] fn bar () {}",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tt_block() {
|
||||
let rules = create_rules(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue