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

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

Issue 1536483002: Skip comments code blocks indented with 4 spaces. (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
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 8b70f868227ff563a4805bc9f364fe0bcc85e4f2..96a4b3e5a0af5968fbc164099b26e3820c9c908b 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -6764,6 +6764,28 @@ void''');
expect(reference.offset, 35);
}
+ void test_parseCommentReferences_skipCodeBlock_4spaces_block() {
+ List<DocumentationCommentToken> tokens = <DocumentationCommentToken>[
+ new DocumentationCommentToken(TokenType.MULTI_LINE_COMMENT,
+ "/**\n * a[i]\n * non-code line\n */", 3)
+ ];
+ List<CommentReference> references =
+ parse("parseCommentReferences", <Object>[tokens], "");
+ expect(references, isEmpty);
+ }
+
+ void test_parseCommentReferences_skipCodeBlock_4spaces_lines() {
+ List<DocumentationCommentToken> tokens = <DocumentationCommentToken>[
+ new DocumentationCommentToken(
+ TokenType.SINGLE_LINE_COMMENT, "/// Code block:", 0),
+ new DocumentationCommentToken(
+ TokenType.SINGLE_LINE_COMMENT, "/// a[i] == b[i]", 0)
+ ];
+ List<CommentReference> references =
+ parse("parseCommentReferences", <Object>[tokens], "");
+ expect(references, isEmpty);
+ }
+
void test_parseCommentReferences_skipCodeBlock_bracketed() {
List<DocumentationCommentToken> tokens = <DocumentationCommentToken>[
new DocumentationCommentToken(
« pkg/analyzer/lib/src/generated/parser.dart ('K') | « 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