From 94bbf14d0e3ed230e079d0cf55e4c1733dc75385 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 16 Mar 2020 14:28:58 -0700 Subject: [PATCH] tags: Add test where no comments are adjacent to definition --- cli/src/tests/tags_test.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cli/src/tests/tags_test.rs b/cli/src/tests/tags_test.rs index c8c3a969..0a37b618 100644 --- a/cli/src/tests/tags_test.rs +++ b/cli/src/tests/tags_test.rs @@ -101,17 +101,28 @@ fn test_tags_javascript() { getAge() { } } + + // ok + + class Agent { + + } "#, ) .collect::>(); assert_eq!( tags.iter().map(|t| (t.name, t.kind)).collect::>(), - &[("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); }