Index: pkg/analysis_server/test/analysis/notification_outline_test.dart |
diff --git a/pkg/analysis_server/test/analysis/notification_outline_test.dart b/pkg/analysis_server/test/analysis/notification_outline_test.dart |
index fdac6b59c79d2a283bfba1e37f544be81725fc68..ffa4c0a9b3070a7f5ad9d740f5faab8789f4409a 100644 |
--- a/pkg/analysis_server/test/analysis/notification_outline_test.dart |
+++ b/pkg/analysis_server/test/analysis/notification_outline_test.dart |
@@ -21,6 +21,8 @@ main() { |
@reflectiveTest |
class _AnalysisNotificationOutlineTest extends AbstractAnalysisTest { |
+ FileKind fileKind; |
+ String libraryName; |
Outline outline; |
Future prepareOutline() { |
@@ -32,6 +34,8 @@ class _AnalysisNotificationOutlineTest extends AbstractAnalysisTest { |
if (notification.event == ANALYSIS_OUTLINE) { |
var params = new AnalysisOutlineParams.fromNotification(notification); |
if (params.file == testFile) { |
+ fileKind = params.kind; |
+ libraryName = params.libraryName; |
outline = params.outline; |
} |
} |
@@ -311,6 +315,34 @@ class A { |
}); |
} |
+ test_libraryName_hasLibraryDirective() async { |
Brian Wilkerson
2015/10/01 20:01:16
Perhaps add a test for neither library nor part-of
|
+ addTestFile(''' |
+library my.lib; |
+'''); |
+ await prepareOutline(); |
+ expect(fileKind, FileKind.LIBRARY); |
+ expect(libraryName, 'my.lib'); |
+ } |
+ |
+ test_libraryName_hasLibraryPartOfDirectives() async { |
+ addTestFile(''' |
+part of lib.in.part.of; |
+library my.lib; |
+'''); |
+ await prepareOutline(); |
+ expect(fileKind, FileKind.LIBRARY); |
+ expect(libraryName, 'my.lib'); |
+ } |
+ |
+ test_libraryName_hasPartOfDirective() async { |
+ addTestFile(''' |
+part of my.lib; |
+'''); |
+ await prepareOutline(); |
+ expect(fileKind, FileKind.PART); |
+ expect(libraryName, 'my.lib'); |
+ } |
+ |
test_localFunctions() { |
addTestFile(''' |
class A { |