| 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 import 'package:analysis_server/protocol/protocol_generated.dart'; | 5 import 'package:analysis_server/protocol/protocol_generated.dart'; |
| 6 import 'package:analysis_server/src/services/correction/status.dart'; | 6 import 'package:analysis_server/src/services/correction/status.dart'; |
| 7 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; | 7 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; |
| 8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:test/test.dart'; | 10 import 'package:test/test.dart'; |
| 11 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 11 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 12 | 12 |
| 13 import 'abstract_rename.dart'; | 13 import 'abstract_rename.dart'; |
| 14 | 14 |
| 15 main() { | 15 main() { |
| 16 defineReflectiveSuite(() { | 16 defineReflectiveSuite(() { |
| 17 defineReflectiveTests(RenameConstructorTest); | 17 defineReflectiveTests(RenameConstructorTest); |
| 18 defineReflectiveTests(RenameConstructorTest_Driver); | |
| 19 }); | 18 }); |
| 20 } | 19 } |
| 21 | 20 |
| 22 @reflectiveTest | 21 @reflectiveTest |
| 23 class RenameConstructorTest extends RenameRefactoringTest { | 22 class RenameConstructorTest extends RenameRefactoringTest { |
| 23 @override |
| 24 bool get enableNewAnalysisDriver => true; |
| 25 |
| 24 test_checkInitialConditions_inSDK() async { | 26 test_checkInitialConditions_inSDK() async { |
| 25 await indexTestUnit(''' | 27 await indexTestUnit(''' |
| 26 main() { | 28 main() { |
| 27 new String.fromCharCodes([]); | 29 new String.fromCharCodes([]); |
| 28 } | 30 } |
| 29 '''); | 31 '''); |
| 30 createRenameRefactoringAtString('fromCharCodes('); | 32 createRenameRefactoringAtString('fromCharCodes('); |
| 31 // check status | 33 // check status |
| 32 refactoring.newName = 'newName'; | 34 refactoring.newName = 'newName'; |
| 33 RefactoringStatus status = await refactoring.checkInitialConditions(); | 35 RefactoringStatus status = await refactoring.checkInitialConditions(); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 search, (node) => node is ConstructorDeclaration); | 245 search, (node) => node is ConstructorDeclaration); |
| 244 createRenameRefactoringForElement(element); | 246 createRenameRefactoringForElement(element); |
| 245 } | 247 } |
| 246 | 248 |
| 247 void _createConstructorInvocationRefactoring(String search) { | 249 void _createConstructorInvocationRefactoring(String search) { |
| 248 ConstructorElement element = findNodeElementAtString( | 250 ConstructorElement element = findNodeElementAtString( |
| 249 search, (node) => node is InstanceCreationExpression); | 251 search, (node) => node is InstanceCreationExpression); |
| 250 createRenameRefactoringForElement(element); | 252 createRenameRefactoringForElement(element); |
| 251 } | 253 } |
| 252 } | 254 } |
| 253 | |
| 254 @reflectiveTest | |
| 255 class RenameConstructorTest_Driver extends RenameConstructorTest { | |
| 256 @override | |
| 257 bool get enableNewAnalysisDriver => true; | |
| 258 } | |
| OLD | NEW |