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

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

Issue 1373593002: Add navigation region for 'library' directives. (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/domains/analysis/navigation_dart.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_navigation_test.dart
diff --git a/pkg/analysis_server/test/analysis/notification_navigation_test.dart b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
index 41f3a6ff8d55a2c268fde896017c4a8255819caa..fee0d6f8a60ea36005eee60f101f8b4456060b03 100644
--- a/pkg/analysis_server/test/analysis/notification_navigation_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
@@ -103,6 +103,14 @@ class AbstractNavigationTest extends AbstractAnalysisTest {
}
/**
+ * Validates that there is a target in [testTargets] with [testFile], at the
+ * offset of [str] in [testFile], and with the length of [str].
+ */
+ void assertHasTargetString(String str) {
+ assertHasTarget(str, str.length);
+ }
+
+ /**
* Validates that there is no a region at [search] and with the given
* [length].
*/
@@ -581,6 +589,16 @@ main() {
});
}
+ test_library() {
+ addTestFile('''
+library my.lib;
+''');
+ return prepareNavigation().then((_) {
+ assertHasRegionString('my.lib');
+ assertHasTargetString('my.lib');
+ });
+ }
+
test_multiplyDefinedElement() {
addFile('$projectPath/bin/libA.dart', 'library A; int TEST = 1;');
addFile('$projectPath/bin/libB.dart', 'library B; int TEST = 2;');
« no previous file with comments | « pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698