Index: pkg/analysis_server/test/integration/analysis/get_library_dependencies_test.dart |
diff --git a/pkg/analysis_server/test/integration/analysis/get_library_dependencies_test.dart b/pkg/analysis_server/test/integration/analysis/get_library_dependencies_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2aa209290a7c6bcc1d7ed2eca1a26e5fb0162068 |
--- /dev/null |
+++ b/pkg/analysis_server/test/integration/analysis/get_library_dependencies_test.dart |
@@ -0,0 +1,50 @@ |
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+import 'package:analysis_server/plugin/protocol/protocol.dart'; |
+import 'package:test/test.dart'; |
+import 'package:test_reflective_loader/test_reflective_loader.dart'; |
+ |
+import '../integration_tests.dart'; |
+ |
+main() { |
+ defineReflectiveSuite(() { |
+ defineReflectiveTests(GetLibraryDependenciesTest); |
+ }); |
+} |
+ |
+@reflectiveTest |
+class GetLibraryDependenciesTest extends AbstractAnalysisServerIntegrationTest { |
+ @failingTest |
Brian Wilkerson
2017/04/09 16:36:05
Does the test pass in the non-driver case?
devoncarew
2017/04/09 18:23:01
Yes, I wrote the body of the test w/o the driver e
|
+ test_libraryDeps() async { |
+ // This fails with the new analysis driver ('Bad state: Should not be used |
+ // with the new analysis driver') - #29310. |
+ String pathname = sourcePath('test.dart'); |
+ String text = r''' |
+class Foo {} |
+ |
+class Bar { |
+ Foo foo; |
+} |
+'''; |
+ writeFile(pathname, text); |
+ standardAnalysisSetup(); |
+ await analysisFinished; |
+ |
+ AnalysisGetLibraryDependenciesResult result = |
+ await sendAnalysisGetLibraryDependencies(); |
+ List<String> libraries = result.libraries; |
+ Map<String, Map<String, List<String>>> packageMaps = result.packageMap; |
+ |
+ expect(libraries, contains(pathname)); |
+ expect(libraries.any((String lib) => lib.endsWith('core/core.dart')), true); |
+ |
+ expect(packageMaps.keys, hasLength(1)); |
+ Map<String, List<String>> map = packageMaps[packageMaps.keys.first]; |
+ expect(map.keys, isEmpty); |
+ } |
+ |
+ @override |
+ bool get enableNewAnalysisDriver => true; |
+} |