| Index: pkg/analysis_server/test/services/refactoring/extract_method_test.dart
|
| diff --git a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
|
| index e039419e8e5dd5f2357470646e670f09945b0994..39d38556129dbd334a9659a71d7cb957a192dd0b 100644
|
| --- a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
|
| +++ b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
|
| @@ -1032,11 +1032,9 @@ main() {
|
| test_offsets_lengths() {
|
| indexTestUnit('''
|
| main() {
|
| -main() {
|
| int a = 1 + 2;
|
| int b = 1 + 2;
|
| }
|
| -}
|
| ''');
|
| _createRefactoringForString('1 + 2');
|
| // apply refactoring
|
| @@ -1048,6 +1046,50 @@ main() {
|
| });
|
| }
|
|
|
| + test_returnType_expression() {
|
| + indexTestUnit('''
|
| +main() {
|
| + int a = 1 + 2;
|
| +}
|
| +''');
|
| + _createRefactoringForString('1 + 2');
|
| + // do check
|
| + return refactoring.checkInitialConditions().then((_) {
|
| + expect(refactoring.returnType, 'int');
|
| + });
|
| + }
|
| +
|
| + test_returnType_statements() {
|
| + indexTestUnit('''
|
| +main() {
|
| +// start
|
| + double v = 5.0;
|
| +// end
|
| + print(v);
|
| +}
|
| +''');
|
| + _createRefactoringForStartEndComments();
|
| + // do check
|
| + return refactoring.checkInitialConditions().then((_) {
|
| + expect(refactoring.returnType, 'double');
|
| + });
|
| + }
|
| +
|
| + test_returnType_statements_void() {
|
| + indexTestUnit('''
|
| +main() {
|
| +// start
|
| + print(42);
|
| +// end
|
| +}
|
| +''');
|
| + _createRefactoringForStartEndComments();
|
| + // do check
|
| + return refactoring.checkInitialConditions().then((_) {
|
| + expect(refactoring.returnType, 'void');
|
| + });
|
| + }
|
| +
|
| test_setExtractGetter() {
|
| indexTestUnit('''
|
| main() {
|
|
|