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

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

Issue 1405033002: Issue 24599. Fix for requesting navigation for directives. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
Index: pkg/analysis_server/test/analysis/get_navigation_test.dart
diff --git a/pkg/analysis_server/test/analysis/get_navigation_test.dart b/pkg/analysis_server/test/analysis/get_navigation_test.dart
index 34a8010863849a954dcd45255254e5f0c7bd1cea..fb4916975501913f5919b8b1cf7692cc5773c0f1 100644
--- a/pkg/analysis_server/test/analysis/get_navigation_test.dart
+++ b/pkg/analysis_server/test/analysis/get_navigation_test.dart
@@ -58,6 +58,48 @@ main() {
return _checkInvalid(file, -1, -1);
}
+ test_issue24599_importDirective() async {
+ addTestFile('''
+import 'dart:math';
+
+main() {
+}''');
+ await waitForTasksFinished();
+ await _getNavigation(testFile, 0, 17);
+ expect(regions, hasLength(1));
+ assertHasRegionString("'dart:math'");
+ expect(testTargets, hasLength(1));
+ expect(testTargets[0].kind, ElementKind.LIBRARY);
+ }
+
+ test_issue24599_importKeyword() async {
+ addTestFile('''
+import 'dart:math';
+
+main() {
+}''');
+ await waitForTasksFinished();
+ await _getNavigation(testFile, 0, 1);
+ expect(regions, hasLength(1));
+ assertHasRegionString("'dart:math'");
+ expect(testTargets, hasLength(1));
+ expect(testTargets[0].kind, ElementKind.LIBRARY);
+ }
+
+ test_issue24599_importUri() async {
+ addTestFile('''
+import 'dart:math';
+
+main() {
+}''');
+ await waitForTasksFinished();
+ await _getNavigation(testFile, 7, 11);
+ expect(regions, hasLength(1));
+ assertHasRegionString("'dart:math'");
+ expect(testTargets, hasLength(1));
+ expect(testTargets[0].kind, ElementKind.LIBRARY);
+ }
+
test_multipleRegions() async {
addTestFile('''
main() {

Powered by Google App Engine
This is Rietveld 408576698