Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Unified Diff: pkg/analysis_server/test/services/refactoring/move_file_test.dart

Issue 1786013004: Start using the new index in Analysis Server. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 2de53d852bb8a2a5e73471ba0fa1836d4d54e58d..1e8d58b997695dd12b43f3d4b1f06eb535c85474 100644
--- a/pkg/analysis_server/test/services/refactoring/move_file_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
@@ -26,6 +26,41 @@ main() {
class MoveFileTest extends RefactoringTest {
MoveFileRefactoring refactoring;
+ /**
+ * TODO(scheglov) fix search of units
+ */
+ fail_file_importedLibrary_package() async {
Brian Wilkerson 2016/03/11 21:50:16 Should we create an issue for this?
+ // 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';
@@ -106,38 +141,6 @@ import '22/new_name.dart';
assertNoFileChange(testFile);
}
- test_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_importedLibrary_up() async {
String pathA = '/project/000/1111/a.dart';
testFile = '/project/000/1111/22/test.dart';
@@ -291,7 +294,7 @@ export 'package:newName/myLib.dart';
}
for (ChangeNotice notice in result.changeNotices) {
if (notice.source.fullName.startsWith('/project/')) {
- index.index(context, notice.resolvedDartUnit);
+ index.indexUnit(notice.resolvedDartUnit);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698