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

Unified Diff: pkg/analysis_server/test/context_manager_test.dart

Issue 1277063002: In analysis server, favor package root setting over ".packages" file. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « pkg/analysis_server/lib/src/context_manager.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/context_manager_test.dart
diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart
index d8cc6196a4598f9badd2572e09cfc6e9c7048aa0..7fb044237e9e066d52039e55f043f23f3b5feb7b 100644
--- a/pkg/analysis_server/test/context_manager_test.dart
+++ b/pkg/analysis_server/test/context_manager_test.dart
@@ -580,6 +580,20 @@ analyzer:
equals('/home/somebody/.pub/cache/unittest-0.9.9/lib/unittest.dart'));
}
+ void test_setRoots_addFolderWithPackagespecAndPackageRoot() {
+ // The package root should take priority.
+ String packagespecPath = posix.join(projPath, '.packages');
+ resourceProvider.newFile(packagespecPath,
+ 'unittest:file:///home/somebody/.pub/cache/unittest-0.9.9/lib/');
+ String packageRootPath = '/package/root/';
+ manager.setRoots(<String>[projPath], <String>[],
+ <String, String>{projPath: packageRootPath});
+ expect(callbacks.currentContextPaths, hasLength(1));
+ expect(callbacks.currentContextPaths, contains(projPath));
+ expect(callbacks.currentContextDispositions[projPath].packageRoot,
+ packageRootPath);
+ }
+
void test_setRoots_addFolderWithPubspec() {
String pubspecPath = posix.join(projPath, 'pubspec.yaml');
resourceProvider.newFile(pubspecPath, 'pubspec');
« no previous file with comments | « pkg/analysis_server/lib/src/context_manager.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698