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

Side by Side Diff: pkg/analysis_services/test/index/dart_index_contributor_test.dart

Issue 398093003: Fix for name declaration indexing in for-in statement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_services/lib/src/index/index_contributor.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.services.src.index.dart_index_contributor; 5 library test.services.src.index.dart_index_contributor;
6 6
7 import 'package:analysis_services/index/index.dart'; 7 import 'package:analysis_services/index/index.dart';
8 import 'package:analysis_services/index/index_store.dart'; 8 import 'package:analysis_services/index/index_store.dart';
9 import 'package:analysis_services/src/index/index_contributor.dart'; 9 import 'package:analysis_services/src/index/index_contributor.dart';
10 import 'package:analysis_testing/reflective_tests.dart'; 10 import 'package:analysis_testing/reflective_tests.dart';
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 _assertRecordedRelation( 145 _assertRecordedRelation(
146 nameElement, 146 nameElement,
147 IndexConstants.IS_INVOKED_BY, 147 IndexConstants.IS_INVOKED_BY,
148 _expectedLocationQ(mainElement, 'method(); // r')); 148 _expectedLocationQ(mainElement, 'method(); // r'));
149 _assertRecordedRelation( 149 _assertRecordedRelation(
150 nameElement, 150 nameElement,
151 IndexConstants.IS_INVOKED_BY, 151 IndexConstants.IS_INVOKED_BY,
152 _expectedLocationQU(mainElement, 'method(); // ur')); 152 _expectedLocationQU(mainElement, 'method(); // ur'));
153 } 153 }
154 154
155 void test_NameElement_isDefinedBy_localVariable_inForEach() {
156 _indexTestUnit('''
157 class A {
158 main() {
159 for (int test in []) {
160 }
161 }
162 }
163 ''');
164 // prepare elements
165 Element mainElement = findElement('main');
166 LocalVariableElement testElement = findElement('test');
167 Element nameElement = new NameElement('test');
168 // verify
169 _assertRecordedRelation(
170 nameElement,
171 IndexConstants.NAME_IS_DEFINED_BY,
172 _expectedLocation(testElement, 'test in []'));
173 }
174
155 void test_NameElement_operator_resolved() { 175 void test_NameElement_operator_resolved() {
156 _indexTestUnit(''' 176 _indexTestUnit('''
157 class A { 177 class A {
158 operator +(o) {} 178 operator +(o) {}
159 operator -(o) {} 179 operator -(o) {}
160 operator ~() {} 180 operator ~() {}
161 operator ==(o) {} 181 operator ==(o) {}
162 } 182 }
163 main(A a) { 183 main(A a) {
164 a + 5; 184 a + 5;
(...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 1722
1703 RecordedRelation(this.element, this.relationship, this.location); 1723 RecordedRelation(this.element, this.relationship, this.location);
1704 1724
1705 @override 1725 @override
1706 String toString() { 1726 String toString() {
1707 return 'RecordedRelation(element=$element; relationship=$relationship; ' 1727 return 'RecordedRelation(element=$element; relationship=$relationship; '
1708 'location=$location; flags=' '${location.isQualified ? "Q" : ""}' 1728 'location=$location; flags=' '${location.isQualified ? "Q" : ""}'
1709 '${location.isResolved ? "R" : ""})'; 1729 '${location.isResolved ? "R" : ""})';
1710 } 1730 }
1711 } 1731 }
OLDNEW
« no previous file with comments | « pkg/analysis_services/lib/src/index/index_contributor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698