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

Unified Diff: pkg/analyzer/test/generated/resolver_test.dart

Issue 1390003002: Issue 24514. Set documentation range for LibraryElement. (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
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {}''');
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698