| 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_local; | 5 library test.services.refactoring.extract_local; |
| 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/refactoring/extract_local.dart'; | 10 import 'package:analysis_server/src/services/refactoring/extract_local.dart'; |
| 11 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; | 11 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; |
| 12 import 'package:unittest/unittest.dart'; | 12 import 'package:unittest/unittest.dart'; |
| 13 | 13 |
| 14 import '../../reflective_tests.dart'; | 14 import '../../reflective_tests.dart'; |
| 15 import 'abstract_refactoring.dart'; | 15 import 'abstract_refactoring.dart'; |
| 16 | 16 |
| 17 | 17 |
| 18 main() { | 18 main() { |
| 19 groupSep = ' | '; | 19 groupSep = ' | '; |
| 20 runReflectiveTests(ExtractLocalTest); | 20 runReflectiveTests(ExtractLocalTest); |
| 21 } | 21 } |
| 22 | 22 |
| 23 | 23 |
| 24 @ReflectiveTestCase() | 24 @reflectiveTest |
| 25 class ExtractLocalTest extends RefactoringTest { | 25 class ExtractLocalTest extends RefactoringTest { |
| 26 ExtractLocalRefactoringImpl refactoring; | 26 ExtractLocalRefactoringImpl refactoring; |
| 27 | 27 |
| 28 test_checkFinalConditions_sameVariable_after() { | 28 test_checkFinalConditions_sameVariable_after() { |
| 29 indexTestUnit(''' | 29 indexTestUnit(''' |
| 30 main() { | 30 main() { |
| 31 int a = 1 + 2; | 31 int a = 1 + 2; |
| 32 var res; | 32 var res; |
| 33 } | 33 } |
| 34 '''); | 34 '''); |
| (...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 int length = search.length; | 967 int length = search.length; |
| 968 _createRefactoring(offset, length); | 968 _createRefactoring(offset, length); |
| 969 } | 969 } |
| 970 | 970 |
| 971 void _createRefactoringWithSuffix(String selectionSearch, String suffix) { | 971 void _createRefactoringWithSuffix(String selectionSearch, String suffix) { |
| 972 int offset = findOffset(selectionSearch + suffix); | 972 int offset = findOffset(selectionSearch + suffix); |
| 973 int length = selectionSearch.length; | 973 int length = selectionSearch.length; |
| 974 _createRefactoring(offset, length); | 974 _createRefactoring(offset, length); |
| 975 } | 975 } |
| 976 } | 976 } |
| OLD | NEW |