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'; |
11 import 'package:analyzer/dart/element/element.dart'; | 11 import 'package:analyzer/dart/element/element.dart'; |
| 12 import 'package:test/test.dart'; |
12 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 13 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
13 import 'package:unittest/unittest.dart'; | |
14 | 14 |
15 import '../../utils.dart'; | 15 import '../../utils.dart'; |
16 import 'abstract_rename.dart'; | 16 import 'abstract_rename.dart'; |
17 | 17 |
18 main() { | 18 main() { |
19 initializeTestEnvironment(); | 19 initializeTestEnvironment(); |
20 defineReflectiveTests(RenameConstructorTest); | 20 defineReflectiveSuite(() { |
| 21 defineReflectiveTests(RenameConstructorTest); |
| 22 }); |
21 } | 23 } |
22 | 24 |
23 @reflectiveTest | 25 @reflectiveTest |
24 class RenameConstructorTest extends RenameRefactoringTest { | 26 class RenameConstructorTest extends RenameRefactoringTest { |
25 test_checkInitialConditions_inSDK() async { | 27 test_checkInitialConditions_inSDK() async { |
26 indexTestUnit(''' | 28 indexTestUnit(''' |
27 main() { | 29 main() { |
28 new String.fromCharCodes([]); | 30 new String.fromCharCodes([]); |
29 } | 31 } |
30 '''); | 32 '''); |
(...skipping 212 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 } |
OLD | NEW |