@@ -866,6 +866,20 @@ abstract class Foo {}
866866 expect (nextToken.type, TokenType .EOF );
867867 }
868868
869+ void test_parseCommentReferences_notCodeBlock_4spaces_afterText () {
870+ List <DocumentationCommentToken > tokens = < DocumentationCommentToken > [
871+ DocumentationCommentToken (
872+ TokenType .SINGLE_LINE_COMMENT , "/// comment:" , 0 ),
873+ DocumentationCommentToken (
874+ TokenType .SINGLE_LINE_COMMENT , "/// a[i] == b[i]" , 0 )
875+ ];
876+ createParser ('' );
877+ List <CommentReference > references = parser.parseCommentReferences (tokens);
878+ expectNotNullIfNoErrors (references);
879+ assertNoErrors ();
880+ expect (references, hasLength (2 ));
881+ }
882+
869883 void test_parseCommentReferences_singleLine () {
870884 List <DocumentationCommentToken > tokens = < DocumentationCommentToken > [
871885 DocumentationCommentToken (
@@ -891,6 +905,36 @@ abstract class Foo {}
891905 expect (reference.offset, 35 );
892906 }
893907
908+ void test_parseCommentReferences_skipCodeBlock_4spaces_afterEmptyComment () {
909+ List <DocumentationCommentToken > tokens = < DocumentationCommentToken > [
910+ DocumentationCommentToken (
911+ TokenType .SINGLE_LINE_COMMENT , "/// Code block:" , 0 ),
912+ DocumentationCommentToken (TokenType .SINGLE_LINE_COMMENT , "///" , 0 ),
913+ DocumentationCommentToken (
914+ TokenType .SINGLE_LINE_COMMENT , "/// a[i] == b[i]" , 0 )
915+ ];
916+ createParser ('' );
917+ List <CommentReference > references = parser.parseCommentReferences (tokens);
918+ expectNotNullIfNoErrors (references);
919+ assertNoErrors ();
920+ expect (references, isEmpty);
921+ }
922+
923+ void test_parseCommentReferences_skipCodeBlock_4spaces_afterEmptyLine () {
924+ List <DocumentationCommentToken > tokens = < DocumentationCommentToken > [
925+ DocumentationCommentToken (
926+ TokenType .SINGLE_LINE_COMMENT , "/// Code block:" , 0 ),
927+ DocumentationCommentToken (TokenType .SINGLE_LINE_COMMENT , "" , 0 ),
928+ DocumentationCommentToken (
929+ TokenType .SINGLE_LINE_COMMENT , "/// a[i] == b[i]" , 0 )
930+ ];
931+ createParser ('' );
932+ List <CommentReference > references = parser.parseCommentReferences (tokens);
933+ expectNotNullIfNoErrors (references);
934+ assertNoErrors ();
935+ expect (references, isEmpty);
936+ }
937+
894938 void test_parseCommentReferences_skipCodeBlock_4spaces_block () {
895939 List <DocumentationCommentToken > tokens = < DocumentationCommentToken > [
896940 DocumentationCommentToken (TokenType .MULTI_LINE_COMMENT ,
@@ -903,12 +947,10 @@ abstract class Foo {}
903947 expect (references, isEmpty);
904948 }
905949
906- void test_parseCommentReferences_skipCodeBlock_4spaces_lines () {
950+ void test_parseCommentReferences_skipCodeBlock_4spaces_first () {
907951 List <DocumentationCommentToken > tokens = < DocumentationCommentToken > [
908952 DocumentationCommentToken (
909- TokenType .SINGLE_LINE_COMMENT , "/// Code block:" , 0 ),
910- DocumentationCommentToken (
911- TokenType .SINGLE_LINE_COMMENT , "/// a[i] == b[i]" , 0 )
953+ TokenType .SINGLE_LINE_COMMENT , "/// a[i] == b[i]" , 0 )
912954 ];
913955 createParser ('' );
914956 List <CommentReference > references = parser.parseCommentReferences (tokens);
0 commit comments