| OLD | NEW |
| 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/search/hierarchy.dart'; | 10 import 'package:analysis_server/src/services/search/hierarchy.dart'; |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 class B extends A { | 269 class B extends A { |
| 270 B() {} | 270 B() {} |
| 271 B.named() {} | 271 B.named() {} |
| 272 var mb1; | 272 var mb1; |
| 273 mb2() {} | 273 mb2() {} |
| 274 } | 274 } |
| 275 '''); | 275 '''); |
| 276 { | 276 { |
| 277 ClassElement classA = findElement('A'); | 277 ClassElement classA = findElement('A'); |
| 278 List<Element> members = getMembers(classA); | 278 List<Element> members = getMembers(classA); |
| 279 expect(members.map((e) => e.name), | 279 expect( |
| 280 unorderedEquals(['ma1', 'ma2', '==', 'toString', 'hashCode'])); | 280 members.map((e) => e.name), |
| 281 unorderedEquals([ |
| 282 'ma1', |
| 283 'ma2', |
| 284 '==', |
| 285 'toString', |
| 286 'hashCode', |
| 287 'noSuchMethod', |
| 288 'runtimeType' |
| 289 ])); |
| 281 } | 290 } |
| 282 { | 291 { |
| 283 ClassElement classB = findElement('B'); | 292 ClassElement classB = findElement('B'); |
| 284 List<Element> members = getMembers(classB); | 293 List<Element> members = getMembers(classB); |
| 285 expect( | 294 expect( |
| 286 members.map((e) => e.name), | 295 members.map((e) => e.name), |
| 287 unorderedEquals( | 296 unorderedEquals([ |
| 288 ['mb1', 'mb2', 'ma1', 'ma2', '==', 'toString', 'hashCode'])); | 297 'mb1', |
| 298 'mb2', |
| 299 'ma1', |
| 300 'ma2', |
| 301 '==', |
| 302 'toString', |
| 303 'hashCode', |
| 304 'noSuchMethod', |
| 305 'runtimeType' |
| 306 ])); |
| 289 } | 307 } |
| 290 } | 308 } |
| 291 | 309 |
| 292 void test_getSuperClasses() { | 310 void test_getSuperClasses() { |
| 293 _indexTestUnit(''' | 311 _indexTestUnit(''' |
| 294 class A {} | 312 class A {} |
| 295 class B extends A {} | 313 class B extends A {} |
| 296 class C extends B {} | 314 class C extends B {} |
| 297 class D extends B implements A {} | 315 class D extends B implements A {} |
| 298 class M {} | 316 class M {} |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 Set<ClassElement> supers = getSuperClasses(classF); | 359 Set<ClassElement> supers = getSuperClasses(classF); |
| 342 expect(supers, unorderedEquals([objectElement, classA])); | 360 expect(supers, unorderedEquals([objectElement, classA])); |
| 343 } | 361 } |
| 344 } | 362 } |
| 345 | 363 |
| 346 void _indexTestUnit(String code) { | 364 void _indexTestUnit(String code) { |
| 347 resolveTestUnit(code); | 365 resolveTestUnit(code); |
| 348 index.indexUnit(testUnit); | 366 index.indexUnit(testUnit); |
| 349 } | 367 } |
| 350 } | 368 } |
| OLD | NEW |