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

Unified Diff: pkg/analysis_server/test/analysis/notification_outline_test.dart

Issue 1380103005: Compute Outline.kind/libraryName actually. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/operation/operation_analysis.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/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 {
« no previous file with comments | « pkg/analysis_server/lib/src/operation/operation_analysis.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698