| 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.edit.refactoring; | 5 library test.edit.refactoring; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/edit/edit_domain.dart'; | 9 import 'package:analysis_server/src/edit/edit_domain.dart'; |
| 10 import 'package:analysis_server/src/protocol.dart'; | 10 import 'package:analysis_server/src/protocol.dart'; |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 }, ''' | 795 }, ''' |
| 796 class A { | 796 class A { |
| 797 set newName(x) {} | 797 set newName(x) {} |
| 798 main() { | 798 main() { |
| 799 newName = 0; | 799 newName = 0; |
| 800 } | 800 } |
| 801 } | 801 } |
| 802 '''); | 802 '''); |
| 803 } | 803 } |
| 804 | 804 |
| 805 test_class_fromInstanceCreation() { |
| 806 addTestFile(''' |
| 807 class Test { |
| 808 Test() {} |
| 809 Test.named() {} |
| 810 } |
| 811 main() { |
| 812 new Test(); |
| 813 new Test.named(); |
| 814 } |
| 815 '''); |
| 816 return assertSuccessfulRefactoring(() { |
| 817 return sendRenameRequest('Test();', 'NewName'); |
| 818 }, ''' |
| 819 class NewName { |
| 820 NewName() {} |
| 821 NewName.named() {} |
| 822 } |
| 823 main() { |
| 824 new NewName(); |
| 825 new NewName.named(); |
| 826 } |
| 827 '''); |
| 828 } |
| 829 |
| 805 test_class_options_fatalError() { | 830 test_class_options_fatalError() { |
| 806 addTestFile(''' | 831 addTestFile(''' |
| 807 class Test {} | 832 class Test {} |
| 808 main() { | 833 main() { |
| 809 Test v; | 834 Test v; |
| 810 } | 835 } |
| 811 '''); | 836 '''); |
| 812 return getRefactoringResult(() { | 837 return getRefactoringResult(() { |
| 813 return sendRenameRequest('Test {}', ''); | 838 return sendRenameRequest('Test {}', ''); |
| 814 }).then((result) { | 839 }).then((result) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 assertTestRefactoringResult(result, ''' | 891 assertTestRefactoringResult(result, ''' |
| 867 class NewName {} | 892 class NewName {} |
| 868 main() { | 893 main() { |
| 869 NewName v; | 894 NewName v; |
| 870 } | 895 } |
| 871 '''); | 896 '''); |
| 872 }); | 897 }); |
| 873 }); | 898 }); |
| 874 } | 899 } |
| 875 | 900 |
| 876 test_constructor() { | 901 test_constructor_fromInstanceCreation() { |
| 877 addTestFile(''' | 902 addTestFile(''' |
| 878 class A { | 903 class A { |
| 879 A.test() {} | 904 A.test() {} |
| 880 } | 905 } |
| 881 main() { | 906 main() { |
| 882 new A.test(); | 907 new A.test(); |
| 883 } | 908 } |
| 884 '''); | 909 '''); |
| 885 String search = 'test();'; | 910 String search = 'test();'; |
| 886 String newName = 'newName'; | 911 String newName = 'newName'; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 } | 1119 } |
| 1095 | 1120 |
| 1096 @override | 1121 @override |
| 1097 void setUp() { | 1122 void setUp() { |
| 1098 super.setUp(); | 1123 super.setUp(); |
| 1099 server.handlers = [new EditDomainHandler(server),]; | 1124 server.handlers = [new EditDomainHandler(server),]; |
| 1100 createProject(); | 1125 createProject(); |
| 1101 handler = new EditDomainHandler(server); | 1126 handler = new EditDomainHandler(server); |
| 1102 } | 1127 } |
| 1103 } | 1128 } |
| OLD | NEW |