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

Unified Diff: pkg/analysis_server/test/services/index/dart_index_contributor_test.dart

Issue 1385403007: Fix for renaming (an invalid) ClassElement invocation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
Index: pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart b/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
index 91ba872294f977e0a1c0a41cf2ede552acba1069..585366ab67fafaeb6fa89071770f7dacac8331c4 100644
--- a/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
+++ b/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
@@ -802,6 +802,22 @@ main(A p) {
_expectedLocation(mainElement, 'A.field); // 3'));
}
+ void test_isReferencedBy_ClassElement_invocation() {
+ verifyNoTestUnitErrors = false;
+ _indexTestUnit('''
+class A {}
+main() {
+ A(); // invalid code, but still a reference
+}''');
+ // prepare elements
+ Element mainElement = findElement('main');
+ Element classElement = findElement('A');
+ IndexableElement indexable = new IndexableElement(classElement);
+ // verify
+ _assertRecordedRelation(indexable, IndexConstants.IS_REFERENCED_BY,
+ _expectedLocation(mainElement, 'A();'));
+ }
+
void test_isReferencedBy_ClassTypeAlias() {
_indexTestUnit('''
class A {}

Powered by Google App Engine
This is Rietveld 408576698