Index: pkg/analyzer/test/generated/resolver_test.dart |
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart |
index 866010caa589a73d91dbd8c850f711e1a7265492..13391621d600e696f99fcba19c1de5047d8cae25 100644 |
--- a/pkg/analyzer/test/generated/resolver_test.dart |
+++ b/pkg/analyzer/test/generated/resolver_test.dart |
@@ -5931,6 +5931,21 @@ void set V(int v) {}'''); |
expect(unit.topLevelVariables, hasLength(0)); |
} |
+ void test_libraryElement_docRange() { |
+ String code = r''' |
+/// My dart doc. |
+library lib; |
+ |
+class A {}'''; |
+ Source librarySource = addSource("/lib.dart", code); |
+ LibraryElement element = _buildLibrary(librarySource); |
+ expect(element, isNotNull); |
+ SourceRange docRange = element.docRange; |
+ expect(docRange, isNotNull); |
+ expect(docRange.offset, code.indexOf('/// My dart doc.')); |
+ expect(docRange.length, '/// My dart doc.'.length); |
+ } |
+ |
void test_missingLibraryDirectiveWithPart() { |
addSource("/a.dart", "part of lib;"); |
Source librarySource = addSource("/lib.dart", "part 'a.dart';"); |
@@ -5989,6 +6004,7 @@ class C {}'''); |
Source librarySource = addSource( |
"/lib.dart", |
r''' |
+/// My dart doc. |
library lib; |
class A {}'''); |