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

Unified Diff: pkg/analysis_server/test/services/search/search_engine_test.dart

Issue 1828793002: Fix for searching LocalVariableElement of DeclaredIdentifier. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | pkg/analyzer/lib/src/dart/element/element.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/search/search_engine_test.dart
diff --git a/pkg/analysis_server/test/services/search/search_engine_test.dart b/pkg/analysis_server/test/services/search/search_engine_test.dart
index 70caeff009cd82cbfe76b4910190cd68455d142e..ffdfd4c58f3957c80d47f954cd72a2ef1ec3bc4e 100644
--- a/pkg/analysis_server/test/services/search/search_engine_test.dart
+++ b/pkg/analysis_server/test/services/search/search_engine_test.dart
@@ -525,6 +525,28 @@ main() {
await _verifyReferences(element, expected);
}
+ test_searchReferences_LocalVariableElement_inForEachLoop() async {
+ _indexTestUnit('''
+main() {
+ for (var v in []) {
+ v = 1;
+ v += 2;
+ print(v);
+ v();
+ }
+}
+''');
+ LocalVariableElement element = findElement('v');
+ Element mainElement = findElement('main');
+ var expected = [
+ _expectId(mainElement, MatchKind.WRITE, 'v = 1;'),
+ _expectId(mainElement, MatchKind.READ_WRITE, 'v += 2;'),
+ _expectId(mainElement, MatchKind.READ, 'v);'),
+ _expectId(mainElement, MatchKind.INVOCATION, 'v();')
+ ];
+ await _verifyReferences(element, expected);
+ }
+
test_searchReferences_MethodElement() async {
_indexTestUnit('''
class A {
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/element/element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698