Index: pkg/analyzer/test/src/task/dart_test.dart |
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart |
index c07689b09a01e81f099f6f991fcce682fe2c99c4..b0352cb3215e19fa9882bde3ecd15218302b1c85 100644 |
--- a/pkg/analyzer/test/src/task/dart_test.dart |
+++ b/pkg/analyzer/test/src/task/dart_test.dart |
@@ -2227,7 +2227,7 @@ class GatherUsedImportedElementsTaskTest extends _AbstractDartTaskTest { |
UsedImportedElements usedElements; |
Set<String> usedElementNames; |
- test_perform() { |
+ test_perform_inBody() { |
newSource( |
'/a.dart', |
r''' |
@@ -2253,6 +2253,54 @@ main() { |
expect(usedElementNames, unorderedEquals(['A'])); |
} |
+ test_perform_inComment_exportDirective() { |
+ Source source = newSource( |
+ '/test.dart', |
+ r''' |
+import 'dart:async'; |
+/// Use [Future]. |
+export 'dart:math'; |
+'''); |
+ _computeUsedElements(source); |
+ expect(usedElementNames, unorderedEquals(['Future'])); |
+ } |
+ |
+ test_perform_inComment_importDirective() { |
+ Source source = newSource( |
+ '/test.dart', |
+ r''' |
+import 'dart:async'; |
+/// Use [Future]. |
+import 'dart:math'; |
+'''); |
+ _computeUsedElements(source); |
+ expect(usedElementNames, unorderedEquals(['Future'])); |
+ } |
+ |
+ test_perform_inComment_libraryDirective() { |
+ Source source = newSource( |
+ '/test.dart', |
+ r''' |
+/// Use [Future]. |
+library test; |
+import 'dart:async'; |
+'''); |
+ _computeUsedElements(source); |
+ expect(usedElementNames, unorderedEquals(['Future'])); |
+ } |
+ |
+ test_perform_inComment_topLevelFunction() { |
+ Source source = newSource( |
+ '/test.dart', |
+ r''' |
+import 'dart:async'; |
+/// Use [Future]. |
+main() {} |
+'''); |
+ _computeUsedElements(source); |
+ expect(usedElementNames, unorderedEquals(['Future'])); |
+ } |
+ |
void _computeUsedElements(Source source) { |
LibrarySpecificUnit target = new LibrarySpecificUnit(source, source); |
computeResult(target, USED_IMPORTED_ELEMENTS, |