| 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.refactoring.rename_constructor; | 5 library test.services.refactoring.rename_constructor; |
| 6 | 6 |
| 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/src/services/correction/status.dart'; | 8 import 'package:analysis_server/src/services/correction/status.dart'; |
| 9 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; | 9 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 B() : super() {} | 228 B() : super() {} |
| 229 factory B._() = A; | 229 factory B._() = A; |
| 230 } | 230 } |
| 231 main() { | 231 main() { |
| 232 new A(); | 232 new A(); |
| 233 } | 233 } |
| 234 '''); | 234 '''); |
| 235 } | 235 } |
| 236 | 236 |
| 237 test_newInstance_nullElement() async { | 237 test_newInstance_nullElement() async { |
| 238 RenameRefactoring refactoring = new RenameRefactoring(searchEngine, null); | 238 RenameRefactoring refactoring = |
| 239 new RenameRefactoring(searchEngine, null, null); |
| 239 expect(refactoring, isNull); | 240 expect(refactoring, isNull); |
| 240 } | 241 } |
| 241 | 242 |
| 242 void _createConstructorDeclarationRefactoring(String search) { | 243 void _createConstructorDeclarationRefactoring(String search) { |
| 243 ConstructorElement element = findNodeElementAtString( | 244 ConstructorElement element = findNodeElementAtString( |
| 244 search, (node) => node is ConstructorDeclaration); | 245 search, (node) => node is ConstructorDeclaration); |
| 245 createRenameRefactoringForElement(element); | 246 createRenameRefactoringForElement(element); |
| 246 } | 247 } |
| 247 | 248 |
| 248 void _createConstructorInvocationRefactoring(String search) { | 249 void _createConstructorInvocationRefactoring(String search) { |
| 249 ConstructorElement element = findNodeElementAtString( | 250 ConstructorElement element = findNodeElementAtString( |
| 250 search, (node) => node is InstanceCreationExpression); | 251 search, (node) => node is InstanceCreationExpression); |
| 251 createRenameRefactoringForElement(element); | 252 createRenameRefactoringForElement(element); |
| 252 } | 253 } |
| 253 } | 254 } |
| 254 | 255 |
| 255 @reflectiveTest | 256 @reflectiveTest |
| 256 class RenameConstructorTest_Driver extends RenameConstructorTest { | 257 class RenameConstructorTest_Driver extends RenameConstructorTest { |
| 257 @override | 258 @override |
| 258 bool get enableNewAnalysisDriver => true; | 259 bool get enableNewAnalysisDriver => true; |
| 259 } | 260 } |
| OLD | NEW |