Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1369)

Unified Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 1527393002: Don't produce [references] in GitHub-like code blocks in comments. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/parser_test.dart
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 8a077a154563b2b00714ad7293918d5b0aebb28b..8b70f868227ff563a4805bc9f364fe0bcc85e4f2 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -6778,6 +6778,30 @@ void''');
expect(reference.offset, 24);
}
+ void test_parseCommentReferences_skipCodeBlock_gitHub() {
+ List<DocumentationCommentToken> tokens = <DocumentationCommentToken>[
+ new DocumentationCommentToken(
+ TokenType.MULTI_LINE_COMMENT, "/** `a[i]` and [b] */", 0)
+ ];
+ List<CommentReference> references =
+ parse("parseCommentReferences", <Object>[tokens], "");
+ expect(references, hasLength(1));
+ CommentReference reference = references[0];
+ expect(reference, isNotNull);
+ expect(reference.identifier, isNotNull);
+ expect(reference.offset, 16);
+ }
+
+ void test_parseCommentReferences_skipCodeBlock_gitHub_notTerminated() {
+ List<DocumentationCommentToken> tokens = <DocumentationCommentToken>[
+ new DocumentationCommentToken(
+ TokenType.MULTI_LINE_COMMENT, "/** `a[i] and [b] */", 0)
+ ];
+ List<CommentReference> references =
+ parse("parseCommentReferences", <Object>[tokens], "");
+ expect(references, hasLength(2));
+ }
+
void test_parseCommentReferences_skipCodeBlock_spaces() {
List<DocumentationCommentToken> tokens = <DocumentationCommentToken>[
new DocumentationCommentToken(TokenType.MULTI_LINE_COMMENT,
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698