| Index: pkg/analysis_server/test/edit/refactoring_test.dart
|
| diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart
|
| index f5b1a893f0efac49640c48d367f83dad0bf43710..8db3bcc3511214ea835be8eb4692169e09ace461 100644
|
| --- a/pkg/analysis_server/test/edit/refactoring_test.dart
|
| +++ b/pkg/analysis_server/test/edit/refactoring_test.dart
|
| @@ -23,6 +23,9 @@ main() {
|
|
|
| @ReflectiveTestCase()
|
| class GetAvailableRefactoringsTest extends AbstractAnalysisTest {
|
| + /**
|
| + * Tests that there is a RENAME refactoring available at the [search] offset.
|
| + */
|
| Future assertHasRenameRefactoring(String code, String search) {
|
| addTestFile(code);
|
| return waitForTasksFinished().then((_) {
|
| @@ -31,6 +34,10 @@ class GetAvailableRefactoringsTest extends AbstractAnalysisTest {
|
| });
|
| }
|
|
|
| + /**
|
| + * Returns the list of available refactorings of the offset of [search] with
|
| + * [length] characters selected.
|
| + */
|
| List<String> getAvailableRefactorings(String search, [int length = 0]) {
|
| Request request = new Request('0', EDIT_GET_AVAILABLE_REFACTORINGS);
|
| request.setParameter(FILE, testFile);
|
| @@ -85,6 +92,25 @@ main() {
|
| ''', 'import ');
|
| }
|
|
|
| + Future test_rename_hasElement_importElement_prefixDecl() {
|
| + return assertHasRenameRefactoring('''
|
| +import 'dart:math' as math;
|
| +main() {
|
| + math.PI;
|
| +}
|
| +''', 'math;');
|
| + }
|
| +
|
| + Future test_rename_hasElement_importElement_prefixRef() {
|
| + return assertHasRenameRefactoring('''
|
| +import 'dart:async' as test;
|
| +import 'dart:math' as test;
|
| +main() {
|
| + test.PI;
|
| +}
|
| +''', 'test.PI;');
|
| + }
|
| +
|
| Future test_rename_hasElement_instanceGetter() {
|
| return assertHasRenameRefactoring('''
|
| class A {
|
|
|