aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast.rs')
-rw-r--r--crates/ra_syntax/src/ast.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs
index 7fca5661e..521ca8ab8 100644
--- a/crates/ra_syntax/src/ast.rs
+++ b/crates/ra_syntax/src/ast.rs
@@ -16,7 +16,9 @@ use crate::{
16}; 16};
17 17
18pub use self::{ 18pub use self::{
19 expr_extensions::{ArrayExprKind, BinOp, ElseBranch, LiteralKind, PrefixOp, RangeOp}, 19 expr_extensions::{
20 ArrayExprKind, BinOp, BlockModifier, ElseBranch, LiteralKind, PrefixOp, RangeOp,
21 },
20 extensions::{ 22 extensions::{
21 AttrKind, FieldKind, NameOrNameRef, PathSegmentKind, SelfParamKind, SlicePatComponents, 23 AttrKind, FieldKind, NameOrNameRef, PathSegmentKind, SelfParamKind, SlicePatComponents,
22 StructKind, TypeBoundKind, VisibilityKind, 24 StructKind, TypeBoundKind, VisibilityKind,
@@ -243,6 +245,21 @@ fn test_comments_preserve_trailing_whitespace() {
243} 245}
244 246
245#[test] 247#[test]
248fn test_four_slash_line_comment() {
249 let file = SourceFile::parse(
250 r#"
251 //// too many slashes to be a doc comment
252 /// doc comment
253 mod foo {}
254 "#,
255 )
256 .ok()
257 .unwrap();
258 let module = file.syntax().descendants().find_map(Module::cast).unwrap();
259 assert_eq!("doc comment", module.doc_comment_text().unwrap());
260}
261
262#[test]
246fn test_where_predicates() { 263fn test_where_predicates() {
247 fn assert_bound(text: &str, bound: Option<TypeBound>) { 264 fn assert_bound(text: &str, bound: Option<TypeBound>) {
248 assert_eq!(text, bound.unwrap().syntax().text().to_string()); 265 assert_eq!(text, bound.unwrap().syntax().text().to_string());