add mod doc comments test in ast
This commit is contained in:
parent
f604ff5b2f
commit
a0ef196d04
@ -481,3 +481,16 @@ pub fn op(&self) -> Option<PrefixOp> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[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…
Reference in New Issue
Block a user