| Index: pkg/analysis_server/test/services/refactoring/move_file_test.dart
|
| diff --git a/pkg/analysis_server/test/services/refactoring/move_file_test.dart b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
|
| index 1e8d58b997695dd12b43f3d4b1f06eb535c85474..9146b93597e065d1930b36258c524ea4dbc5a4ce 100644
|
| --- a/pkg/analysis_server/test/services/refactoring/move_file_test.dart
|
| +++ b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
|
| @@ -26,41 +26,6 @@ main() {
|
| class MoveFileTest extends RefactoringTest {
|
| MoveFileRefactoring refactoring;
|
|
|
| - /**
|
| - * TODO(scheglov) fix search of units
|
| - */
|
| - fail_file_importedLibrary_package() async {
|
| - // configure packages
|
| - testFile = '/packages/my_pkg/aaa/test.dart';
|
| - provider.newFile(testFile, '');
|
| - Map<String, List<Folder>> packageMap = {
|
| - 'my_pkg': [provider.getResource('/packages/my_pkg')]
|
| - };
|
| - context.sourceFactory = new SourceFactory([
|
| - AbstractContextTest.SDK_RESOLVER,
|
| - new PackageMapUriResolver(provider, packageMap),
|
| - resourceResolver
|
| - ]);
|
| - // do testing
|
| - String pathA = '/project/bin/a.dart';
|
| - addSource(
|
| - pathA,
|
| - '''
|
| -import 'package:my_pkg/aaa/test.dart';
|
| -''');
|
| - addTestSource('');
|
| - _performAnalysis();
|
| - // perform refactoring
|
| - _createRefactoring('/packages/my_pkg/bbb/ccc/new_name.dart');
|
| - await _assertSuccessfulRefactoring();
|
| - assertFileChangeResult(
|
| - pathA,
|
| - '''
|
| -import 'package:my_pkg/bbb/ccc/new_name.dart';
|
| -''');
|
| - assertNoFileChange(testFile);
|
| - }
|
| -
|
| test_file_definingUnit() async {
|
| String pathA = '/project/000/1111/a.dart';
|
| String pathB = '/project/000/1111/b.dart';
|
| @@ -141,6 +106,38 @@ import '22/new_name.dart';
|
| assertNoFileChange(testFile);
|
| }
|
|
|
| + test_file_importedLibrary_package() async {
|
| + // configure packages
|
| + testFile = '/packages/my_pkg/lib/aaa/test.dart';
|
| + provider.newFile(testFile, '');
|
| + Map<String, List<Folder>> packageMap = {
|
| + 'my_pkg': [provider.getResource('/packages/my_pkg/lib')]
|
| + };
|
| + context.sourceFactory = new SourceFactory([
|
| + AbstractContextTest.SDK_RESOLVER,
|
| + new PackageMapUriResolver(provider, packageMap),
|
| + resourceResolver
|
| + ]);
|
| + // do testing
|
| + String pathA = '/project/bin/a.dart';
|
| + addSource(
|
| + pathA,
|
| + '''
|
| +import 'package:my_pkg/aaa/test.dart';
|
| +''');
|
| + addTestSource('', Uri.parse('package:my_pkg/aaa/test.dart'));
|
| + _performAnalysis();
|
| + // perform refactoring
|
| + _createRefactoring('/packages/my_pkg/lib/bbb/ccc/new_name.dart');
|
| + await _assertSuccessfulRefactoring();
|
| + assertFileChangeResult(
|
| + pathA,
|
| + '''
|
| +import 'package:my_pkg/bbb/ccc/new_name.dart';
|
| +''');
|
| + assertNoFileChange(testFile);
|
| + }
|
| +
|
| test_file_importedLibrary_up() async {
|
| String pathA = '/project/000/1111/a.dart';
|
| testFile = '/project/000/1111/22/test.dart';
|
|
|