diff options
author | csmoe <[email protected]> | 2019-01-04 13:51:45 +0000 |
---|---|---|
committer | csmoe <[email protected]> | 2019-01-04 13:51:45 +0000 |
commit | a0ef196d0404cf89367928f347dd515ba31d081b (patch) | |
tree | 6b23591e5a58341ff7696d8e3f90ecdf4c30ca2c /crates/ra_syntax/src | |
parent | f604ff5b2f72a593e23953ed8be7e9cbeba5d287 (diff) |
add mod doc comments test in ast
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/ast.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index c5273a7a2..3aaa5edda 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -481,3 +481,16 @@ impl<'a> PrefixExpr<'a> { | |||
481 | } | 481 | } |
482 | } | 482 | } |
483 | } | 483 | } |
484 | |||
485 | #[test] | ||
486 | fn test_doc_comment_of_items() { | ||
487 | let file = SourceFileNode::parse( | ||
488 | r#" | ||
489 | //! doc | ||
490 | // non-doc | ||
491 | mod foo {} | ||
492 | "#, | ||
493 | ); | ||
494 | let module = file.syntax().descendants().find_map(Module::cast).unwrap(); | ||
495 | assert_eq!("doc", module.doc_comment_text()); | ||
496 | } | ||