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

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

Issue 2081603002: When copying TokenWithComment, use copy of its comments. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months 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/dart/ast/token.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/utilities_test.dart
diff --git a/pkg/analyzer/test/generated/utilities_test.dart b/pkg/analyzer/test/generated/utilities_test.dart
index 344612bf6ea46c2fba1aa02e90fd4b2df699b9f7..a4de8c00b94aa0cc535d0f6cd2777ee34179652e 100644
--- a/pkg/analyzer/test/generated/utilities_test.dart
+++ b/pkg/analyzer/test/generated/utilities_test.dart
@@ -59,6 +59,12 @@ class AstCloneComparator extends AstComparator {
fail('Failed to copy token: ${first.lexeme} (${first.offset})');
return false;
}
+ if (first is TokenWithComment) {
+ CommentToken comment = first.precedingComments;
+ if (comment.parent != first) {
+ fail('Failed to link the comment "$comment" with the token "$first".');
+ }
+ }
return super.isEqualTokens(first, second);
}
}
@@ -77,6 +83,13 @@ class AstClonerTest extends EngineTestCase {
_assertCloneUnitMember('@A.c() main() {}');
}
+ void test_visitAnnotation_withComment() {
+ CompilationUnitMember clazz =
+ _parseUnitMember('/** comment */ @deprecated class A {}');
+ Annotation annotation = clazz.metadata.single;
+ _assertClone(annotation);
+ }
+
void test_visitArgumentList() {
_assertCloneExpression('m(a, b)');
}
« no previous file with comments | « pkg/analyzer/lib/src/dart/ast/token.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698