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 c810386b6b35c8fed3c84f24cdfa1a8da21857d1..41a16073813b2c9e2a03332a388b02b0de3cf118 100644 |
--- a/pkg/analysis_server/test/context_manager_test.dart |
+++ b/pkg/analysis_server/test/context_manager_test.dart |
@@ -344,6 +344,42 @@ analyzer: |
expect(contexts[1].name, equals('/my/proj/lib')); |
} |
+ test_sdk_ext_packagespec() async { |
Paul Berry
2015/08/13 17:12:07
This test verifies correct behavior of your change
Cutch
2015/08/13 19:24:17
Done.
|
+ // Create files. |
+ String libPath = newFolder([projPath, LIB_NAME]); |
+ newFile([libPath, 'main.dart']); |
+ newFile([libPath, 'nope.dart']); |
+ String sdkExtPath = newFolder([projPath, 'sdk_ext']); |
+ newFile([sdkExtPath, 'entry.dart']); |
+ String sdkExtSrcPath = newFolder([projPath, 'sdk_ext', 'src']); |
+ newFile([sdkExtSrcPath, 'part.dart']); |
+ // Setup sdk extension mapping. |
+ newFile( |
+ [libPath, '_sdkext'], |
+ r''' |
+{ |
+ "dart:foobar": "../sdk_ext/entry.dart" |
+} |
+'''); |
+ // Setup .packages file |
+ newFile( |
+ [projPath, '.packages'], |
+ r''' |
+test_pack:lib/ |
+'''); |
+ // Setup context. |
+ manager.setRoots(<String>[projPath], <String>[], <String, String>{}); |
+ // Confirm that one context was created. |
+ var contexts = |
+ manager.contextsInAnalysisRoot(resourceProvider.newFolder(projPath)); |
+ expect(contexts, isNotNull); |
+ expect(contexts.length, equals(1)); |
+ var context = contexts[0]; |
+ var source = context.sourceFactory.forUri('dart:foobar'); |
+ expect(source.fullName, equals('/my/proj/sdk_ext/entry.dart')); |
+ } |
+ |
+ |
test_refresh_folder_with_packagespec() { |
// create a context with a .packages file |
String packagespecFile = posix.join(projPath, '.packages'); |