mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
add mod doc comments test in ast
This commit is contained in:
parent
f604ff5b2f
commit
a0ef196d04
1 changed files with 13 additions and 0 deletions
|
@ -481,3 +481,16 @@ impl<'a> PrefixExpr<'a> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_doc_comment_of_items() {
|
||||
let file = SourceFileNode::parse(
|
||||
r#"
|
||||
//! doc
|
||||
// non-doc
|
||||
mod foo {}
|
||||
"#,
|
||||
);
|
||||
let module = file.syntax().descendants().find_map(Module::cast).unwrap();
|
||||
assert_eq!("doc", module.doc_comment_text());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue