| 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.extract_method; | 5 library test.services.refactoring.extract_method; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart'; | 9 import 'package:analysis_server/src/protocol.dart'; |
| 10 import 'package:analysis_server/src/services/correction/status.dart'; | 10 import 'package:analysis_server/src/services/correction/status.dart'; |
| (...skipping 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1797 '''); | 1797 '''); |
| 1798 _createRefactoringForString('v1 + v2 + v1'); | 1798 _createRefactoringForString('v1 + v2 + v1'); |
| 1799 // apply refactoring | 1799 // apply refactoring |
| 1800 return _assertSuccessfulRefactoring(''' | 1800 return _assertSuccessfulRefactoring(''' |
| 1801 main() { | 1801 main() { |
| 1802 var v1 = 1; | 1802 var v1 = 1; |
| 1803 var v2 = 2; | 1803 var v2 = 2; |
| 1804 var a = res(v1, v2); // marker | 1804 var a = res(v1, v2); // marker |
| 1805 } | 1805 } |
| 1806 | 1806 |
| 1807 num res(int v1, int v2) => v1 + v2 + v1; | 1807 int res(int v1, int v2) => v1 + v2 + v1; |
| 1808 '''); | 1808 '''); |
| 1809 } | 1809 } |
| 1810 | 1810 |
| 1811 test_statements_assignment() { | 1811 test_statements_assignment() { |
| 1812 indexTestUnit(''' | 1812 indexTestUnit(''' |
| 1813 main() { | 1813 main() { |
| 1814 int v; | 1814 int v; |
| 1815 // start | 1815 // start |
| 1816 v = 5; | 1816 v = 5; |
| 1817 // end | 1817 // end |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2748 * Returns a deep copy of [refactoring] parameters. | 2748 * Returns a deep copy of [refactoring] parameters. |
| 2749 * There was a bug masked by updating parameter instances shared between the | 2749 * There was a bug masked by updating parameter instances shared between the |
| 2750 * refactoring and the test. | 2750 * refactoring and the test. |
| 2751 */ | 2751 */ |
| 2752 List<RefactoringMethodParameter> _getParametersCopy() { | 2752 List<RefactoringMethodParameter> _getParametersCopy() { |
| 2753 return refactoring.parameters.map((p) { | 2753 return refactoring.parameters.map((p) { |
| 2754 return new RefactoringMethodParameter(p.kind, p.type, p.name, id: p.id); | 2754 return new RefactoringMethodParameter(p.kind, p.type, p.name, id: p.id); |
| 2755 }).toList(); | 2755 }).toList(); |
| 2756 } | 2756 } |
| 2757 } | 2757 } |
| OLD | NEW |