| 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 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analysis_server/protocol/protocol_generated.dart'; | 7 import 'package:analysis_server/protocol/protocol_generated.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/extract_method.dart'; | 9 import 'package:analysis_server/src/services/refactoring/extract_method.dart'; |
| 10 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; | 10 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; |
| 11 import 'package:test/test.dart'; | 11 import 'package:test/test.dart'; |
| 12 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 12 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 13 | 13 |
| 14 import 'abstract_refactoring.dart'; | 14 import 'abstract_refactoring.dart'; |
| 15 | 15 |
| 16 main() { | 16 main() { |
| 17 defineReflectiveSuite(() { | 17 defineReflectiveSuite(() { |
| 18 defineReflectiveTests(ExtractMethodTest); | 18 defineReflectiveTests(ExtractMethodTest); |
| 19 defineReflectiveTests(ExtractMethodTest_Driver); | |
| 20 }); | 19 }); |
| 21 } | 20 } |
| 22 | 21 |
| 23 @reflectiveTest | 22 @reflectiveTest |
| 24 class ExtractMethodTest extends RefactoringTest { | 23 class ExtractMethodTest extends RefactoringTest { |
| 25 ExtractMethodRefactoringImpl refactoring; | 24 ExtractMethodRefactoringImpl refactoring; |
| 26 | 25 |
| 26 @override |
| 27 bool get enableNewAnalysisDriver => true; |
| 28 |
| 27 test_bad_assignmentLeftHandSide() async { | 29 test_bad_assignmentLeftHandSide() async { |
| 28 await indexTestUnit(''' | 30 await indexTestUnit(''' |
| 29 main() { | 31 main() { |
| 30 int aaa; | 32 int aaa; |
| 31 aaa = 0; | 33 aaa = 0; |
| 32 } | 34 } |
| 33 '''); | 35 '''); |
| 34 _createRefactoringForString('aaa '); | 36 _createRefactoringForString('aaa '); |
| 35 return _assertConditionsFatal( | 37 return _assertConditionsFatal( |
| 36 'Cannot extract the left-hand side of an assignment.'); | 38 'Cannot extract the left-hand side of an assignment.'); |
| (...skipping 2797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2834 * Returns a deep copy of [refactoring] parameters. | 2836 * Returns a deep copy of [refactoring] parameters. |
| 2835 * There was a bug masked by updating parameter instances shared between the | 2837 * There was a bug masked by updating parameter instances shared between the |
| 2836 * refactoring and the test. | 2838 * refactoring and the test. |
| 2837 */ | 2839 */ |
| 2838 List<RefactoringMethodParameter> _getParametersCopy() { | 2840 List<RefactoringMethodParameter> _getParametersCopy() { |
| 2839 return refactoring.parameters.map((p) { | 2841 return refactoring.parameters.map((p) { |
| 2840 return new RefactoringMethodParameter(p.kind, p.type, p.name, id: p.id); | 2842 return new RefactoringMethodParameter(p.kind, p.type, p.name, id: p.id); |
| 2841 }).toList(); | 2843 }).toList(); |
| 2842 } | 2844 } |
| 2843 } | 2845 } |
| 2844 | |
| 2845 @reflectiveTest | |
| 2846 class ExtractMethodTest_Driver extends ExtractMethodTest { | |
| 2847 @override | |
| 2848 bool get enableNewAnalysisDriver => true; | |
| 2849 } | |
| OLD | NEW |