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 library analyzer.test.src.task.incremental_element_builder_test; | 5 library analyzer.test.src.task.incremental_element_builder_test; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
9 import 'package:analyzer/src/dart/ast/utilities.dart'; | 9 import 'package:analyzer/src/dart/ast/utilities.dart'; |
10 import 'package:analyzer/src/dart/element/element.dart'; | 10 import 'package:analyzer/src/dart/element/element.dart'; |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 expect(elementB.name, 'bbb'); | 678 expect(elementB.name, 'bbb'); |
679 // verify delta | 679 // verify delta |
680 expect(helper.delta.addedConstructors, isEmpty); | 680 expect(helper.delta.addedConstructors, isEmpty); |
681 expect(helper.delta.removedConstructors, isEmpty); | 681 expect(helper.delta.removedConstructors, isEmpty); |
682 expect(helper.delta.addedAccessors, isEmpty); | 682 expect(helper.delta.addedAccessors, isEmpty); |
683 expect(helper.delta.removedAccessors, isEmpty); | 683 expect(helper.delta.removedAccessors, isEmpty); |
684 expect(helper.delta.addedMethods, unorderedEquals([newElementA])); | 684 expect(helper.delta.addedMethods, unorderedEquals([newElementA])); |
685 expect(helper.delta.removedMethods, unorderedEquals([oldElementA])); | 685 expect(helper.delta.removedMethods, unorderedEquals([oldElementA])); |
686 } | 686 } |
687 | 687 |
| 688 test_classDelta_null_abstractKeyword_add() { |
| 689 _verifyNoClassDeltaForTheLast( |
| 690 r''' |
| 691 class A {} |
| 692 ''', |
| 693 r''' |
| 694 abstract class A {} |
| 695 '''); |
| 696 } |
| 697 |
| 698 test_classDelta_null_abstractKeyword_remove() { |
| 699 _verifyNoClassDeltaForTheLast( |
| 700 r''' |
| 701 abstract class A {} |
| 702 ''', |
| 703 r''' |
| 704 class A {} |
| 705 '''); |
| 706 } |
| 707 |
688 test_classDelta_null_extendsClause_add() { | 708 test_classDelta_null_extendsClause_add() { |
689 _verifyNoClassDeltaForTheLast( | 709 _verifyNoClassDeltaForTheLast( |
690 r''' | 710 r''' |
691 class A {} | 711 class A {} |
692 class B {} | 712 class B {} |
693 ''', | 713 ''', |
694 r''' | 714 r''' |
695 class A {} | 715 class A {} |
696 class B extends A {} | 716 class B extends A {} |
697 '''); | 717 '''); |
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 expect(oldClass, isNotNull); | 1895 expect(oldClass, isNotNull); |
1876 element = oldClass.element; | 1896 element = oldClass.element; |
1877 oldVersion = element.version; | 1897 oldVersion = element.version; |
1878 oldMembers = oldClass.members.toList(); | 1898 oldMembers = oldClass.members.toList(); |
1879 } | 1899 } |
1880 | 1900 |
1881 ClassDeclaration _findClassNode(CompilationUnit unit, String name) => | 1901 ClassDeclaration _findClassNode(CompilationUnit unit, String name) => |
1882 unit.declarations.singleWhere((unitMember) => | 1902 unit.declarations.singleWhere((unitMember) => |
1883 unitMember is ClassDeclaration && unitMember.name.name == name); | 1903 unitMember is ClassDeclaration && unitMember.name.name == name); |
1884 } | 1904 } |
OLD | NEW |