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

Side by Side Diff: pkg/analysis_server/test/services/search/hierarchy_test.dart

Issue 783383003: code completion for dynamic type elements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_server/test/services/completion/completion_test_util.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.search.hierarchy; 5 library test.services.src.search.hierarchy;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/services/index/index.dart'; 9 import 'package:analysis_server/src/services/index/index.dart';
10 import 'package:analysis_server/src/services/index/local_memory_index.dart'; 10 import 'package:analysis_server/src/services/index/local_memory_index.dart';
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 class B extends A { 211 class B extends A {
212 B() {} 212 B() {}
213 B.named() {} 213 B.named() {}
214 var mb1; 214 var mb1;
215 mb2() {} 215 mb2() {}
216 } 216 }
217 '''); 217 ''');
218 { 218 {
219 ClassElement classA = findElement('A'); 219 ClassElement classA = findElement('A');
220 List<Element> members = getMembers(classA); 220 List<Element> members = getMembers(classA);
221 expect(members.map((e) => e.name), unorderedEquals(['ma1', 'ma2', '=='])); 221 expect(
222 members.map((e) => e.name),
223 unorderedEquals(['ma1', 'ma2', '==', 'toString']));
222 } 224 }
223 { 225 {
224 ClassElement classB = findElement('B'); 226 ClassElement classB = findElement('B');
225 List<Element> members = getMembers(classB); 227 List<Element> members = getMembers(classB);
226 expect( 228 expect(
227 members.map((e) => e.name), 229 members.map((e) => e.name),
228 unorderedEquals(['mb1', 'mb2', 'ma1', 'ma2', '=='])); 230 unorderedEquals(['mb1', 'mb2', 'ma1', 'ma2', '==', 'toString']));
229 } 231 }
230 } 232 }
231 233
232 Future test_getSubClasses() { 234 Future test_getSubClasses() {
233 _indexTestUnit(''' 235 _indexTestUnit('''
234 class A {} 236 class A {}
235 class B extends A {} 237 class B extends A {}
236 class C extends B {} 238 class C extends B {}
237 class D extends B implements A {} 239 class D extends B implements A {}
238 class M {} 240 class M {}
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 Set<ClassElement> supers = getSuperClasses(classF); 313 Set<ClassElement> supers = getSuperClasses(classF);
312 expect(supers, unorderedEquals([objectElement, classA])); 314 expect(supers, unorderedEquals([objectElement, classA]));
313 } 315 }
314 } 316 }
315 317
316 void _indexTestUnit(String code) { 318 void _indexTestUnit(String code) {
317 resolveTestUnit(code); 319 resolveTestUnit(code);
318 index.indexUnit(context, testUnit); 320 index.indexUnit(context, testUnit);
319 } 321 }
320 } 322 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/services/completion/completion_test_util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698