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 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1616 _buildNewUnit(r''' | 1616 _buildNewUnit(r''' |
1617 f1() { | 1617 f1() { |
1618 print(12); | 1618 print(12); |
1619 } | 1619 } |
1620 f2() { | 1620 f2() { |
1621 B b = new B((C c) {}); | 1621 B b = new B((C c) {}); |
1622 } | 1622 } |
1623 '''); | 1623 '''); |
1624 } | 1624 } |
1625 | 1625 |
1626 test_update_emptyCommentReference() { | 1626 test_update_commentReference_empty() { |
1627 _buildOldUnit(r''' | 1627 _buildOldUnit(r''' |
1628 /// Empty [] reference. | 1628 /// Empty [] reference. |
1629 class A {} | 1629 class A {} |
1630 '''); | 1630 '''); |
1631 _buildNewUnit(r''' | 1631 _buildNewUnit(r''' |
1632 /// Empty [] reference. | 1632 /// Empty [] reference. |
1633 class A {} | 1633 class A {} |
1634 '''); | 1634 '''); |
1635 } | 1635 } |
1636 | 1636 |
| 1637 test_update_commentReference_notClosed() { |
| 1638 _buildOldUnit(r''' |
| 1639 /// [c) |
| 1640 class A {} |
| 1641 '''); |
| 1642 _buildNewUnit(r''' |
| 1643 int a; |
| 1644 /// [c) |
| 1645 class A {} |
| 1646 '''); |
| 1647 } |
| 1648 |
1637 test_update_rewrittenConstructorName() { | 1649 test_update_rewrittenConstructorName() { |
1638 _buildOldUnit(r''' | 1650 _buildOldUnit(r''' |
1639 class A { | 1651 class A { |
1640 A(); | 1652 A(); |
1641 A.named(); | 1653 A.named(); |
1642 } | 1654 } |
1643 | 1655 |
1644 foo() {} | 1656 foo() {} |
1645 | 1657 |
1646 main() { | 1658 main() { |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1839 ClassDeclaration oldClass = _findClassNode(oldUnit, name); | 1851 ClassDeclaration oldClass = _findClassNode(oldUnit, name); |
1840 expect(oldClass, isNotNull); | 1852 expect(oldClass, isNotNull); |
1841 element = oldClass.element; | 1853 element = oldClass.element; |
1842 oldMembers = oldClass.members.toList(); | 1854 oldMembers = oldClass.members.toList(); |
1843 } | 1855 } |
1844 | 1856 |
1845 ClassDeclaration _findClassNode(CompilationUnit unit, String name) => | 1857 ClassDeclaration _findClassNode(CompilationUnit unit, String name) => |
1846 unit.declarations.singleWhere((unitMember) => | 1858 unit.declarations.singleWhere((unitMember) => |
1847 unitMember is ClassDeclaration && unitMember.name.name == name); | 1859 unitMember is ClassDeclaration && unitMember.name.name == name); |
1848 } | 1860 } |
OLD | NEW |