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

Unified Diff: pkg/analyzer/test/src/dart/analysis/search_test.dart

Issue 2619013003: Implement search for LibraryElement in its parts. (Closed)
Patch Set: Created 3 years, 11 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/dart/analysis/search.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/src/dart/analysis/search_test.dart
diff --git a/pkg/analyzer/test/src/dart/analysis/search_test.dart b/pkg/analyzer/test/src/dart/analysis/search_test.dart
index cfffe71eb3162b8f3282f967f3ebf9a6e349287a..6c73bef751f25fb9f4292a8c59c417b4319c6020 100644
--- a/pkg/analyzer/test/src/dart/analysis/search_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/search_test.dart
@@ -465,6 +465,28 @@ label:
await _verifyReferences(element, expected);
}
+ test_searchReferences_LibraryElement() async {
+ var codeA = 'part of lib; // A';
+ var codeB = 'part of lib; // B';
+ provider.newFile(_p('$testProject/unitA.dart'), codeA);
+ provider.newFile(_p('$testProject/unitB.dart'), codeB);
+ await _resolveTestUnit('''
+library lib;
+part 'unitA.dart';
+part 'unitB.dart';
+''');
+ LibraryElement element = testLibraryElement;
+ CompilationUnitElement unitElementA = element.parts[0];
+ CompilationUnitElement unitElementB = element.parts[1];
+ var expected = [
+ new ExpectedResult(unitElementA, SearchResultKind.REFERENCE,
+ codeA.indexOf('lib; // A'), 'lib'.length),
+ new ExpectedResult(unitElementB, SearchResultKind.REFERENCE,
+ codeB.indexOf('lib; // B'), 'lib'.length),
+ ];
+ await _verifyReferences(element, expected);
+ }
+
test_searchReferences_LocalVariableElement() async {
await _resolveTestUnit(r'''
main() {
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/search.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698