OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // Test for iterators on for [SubclassNode]. | 5 // Test for iterators on for [SubclassNode]. |
6 | 6 |
7 library class_set_test; | 7 library class_set_test; |
8 | 8 |
9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
10 import 'package:async_helper/async_helper.dart'; | 10 import 'package:async_helper/async_helper.dart'; |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 | 522 |
523 checkForEach(X, [X, A, B, D, C, G, F, I, H, E], forEachSubtype: true); | 523 checkForEach(X, [X, A, B, D, C, G, F, I, H, E], forEachSubtype: true); |
524 checkForEach(X, [X, A, B, D], stop: D, forEachSubtype: true); | 524 checkForEach(X, [X, A, B, D], stop: D, forEachSubtype: true); |
525 checkForEach(X, [X, A, B, D, C, G, F, E], | 525 checkForEach(X, [X, A, B, D, C, G, F, E], |
526 skipSubclasses: [F], forEachSubtype: true); | 526 skipSubclasses: [F], forEachSubtype: true); |
527 checkForEach(X, [X, A, B, D, C, G, F, I, H, E], | 527 checkForEach(X, [X, A, B, D, C, G, F, I, H, E], |
528 skipSubclasses: [X], forEachSubtype: true); | 528 skipSubclasses: [X], forEachSubtype: true); |
529 checkForEach(X, [X, A, B, D, C, G, F, I, H, E], | 529 checkForEach(X, [X, A, B, D, C, G, F, I, H, E], |
530 skipSubclasses: [D], forEachSubtype: true); | 530 skipSubclasses: [D], forEachSubtype: true); |
531 checkForEach(X, [A, D, C, G, F, I, H, E], | 531 checkForEach(X, [A, D, C, G, F, I, H, E], |
532 forEachSubtype: true, mask: ClassHierarchyNode.DIRECTLY_INSTANTIATED); | 532 forEachSubtype: true, mask: ClassHierarchyNode.EXPLICITLY_INSTANTIATED); |
533 checkForEach(X, [A, B, D, C, G, F, I, H, E], | 533 checkForEach(X, [A, B, D, C, G, F, I, H, E], |
534 forEachSubtype: true, mask: ClassHierarchyNode.INSTANTIATED); | 534 forEachSubtype: true, mask: ClassHierarchyNode.INSTANTIATED); |
535 | 535 |
536 void checkAny(ClassElement cls, List<ClassElement> expected, | 536 void checkAny(ClassElement cls, List<ClassElement> expected, |
537 {ClassElement find, bool expectedResult, bool anySubtype: false}) { | 537 {ClassElement find, bool expectedResult, bool anySubtype: false}) { |
538 ClassSet classSet = world.getClassSet(cls); | 538 ClassSet classSet = world.getClassSet(cls); |
539 List<ClassElement> visited = <ClassElement>[]; | 539 List<ClassElement> visited = <ClassElement>[]; |
540 | 540 |
541 bool visit(ClassElement cls) { | 541 bool visit(ClassElement cls) { |
542 visited.add(cls); | 542 visited.add(cls); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 checkAny(B, [B, D], find: D, anySubtype: true, expectedResult: true); | 576 checkAny(B, [B, D], find: D, anySubtype: true, expectedResult: true); |
577 checkAny(B, [B, D, F, I], find: I, anySubtype: true, expectedResult: true); | 577 checkAny(B, [B, D, F, I], find: I, anySubtype: true, expectedResult: true); |
578 | 578 |
579 checkAny(X, [X, A, B, D, C, G, F, I, H, E], | 579 checkAny(X, [X, A, B, D, C, G, F, I, H, E], |
580 anySubtype: true, expectedResult: false); | 580 anySubtype: true, expectedResult: false); |
581 checkAny(X, [X, A], find: A, anySubtype: true, expectedResult: true); | 581 checkAny(X, [X, A], find: A, anySubtype: true, expectedResult: true); |
582 checkAny(X, [X, A, B, D], find: D, anySubtype: true, expectedResult: true); | 582 checkAny(X, [X, A, B, D], find: D, anySubtype: true, expectedResult: true); |
583 checkAny(X, [X, A, B, D, C, G, F, I], | 583 checkAny(X, [X, A, B, D, C, G, F, I], |
584 find: I, anySubtype: true, expectedResult: true); | 584 find: I, anySubtype: true, expectedResult: true); |
585 } | 585 } |
OLD | NEW |