tags: Add test where no comments are adjacent to definition

This commit is contained in:
Max Brunsfeld 2020-03-16 14:28:58 -07:00
parent 65f2874b9e
commit 94bbf14d0e

View file

@ -101,17 +101,28 @@ fn test_tags_javascript() {
getAge() {
}
}
// ok
class Agent {
}
"#,
)
.collect::<Vec<_>>();
assert_eq!(
tags.iter().map(|t| (t.name, t.kind)).collect::<Vec<_>>(),
&[("getAge", TagKind::Method), ("Customer", TagKind::Class)]
&[
("getAge", TagKind::Method),
("Customer", TagKind::Class),
("Agent", TagKind::Class)
]
);
assert_eq!(tags[0].docs.as_ref().unwrap(), "Get the customer's age");
assert_eq!(
tags[1].docs.as_ref().unwrap(),
"Data about a customer.\nbla bla bla"
);
assert_eq!(tags[2].docs, None);
}