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

Unified Diff: pkg/analysis_server/test/services/completion/dart/completion_manager_test.dart

Issue 2982993003: Remove UriReferencedElement with its uri/uriOffset/uriEnd properties. (Closed)
Patch Set: Merge. Created 3 years, 5 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/analysis_server/lib/src/status/element_writer.dart ('k') | pkg/analyzer/lib/dart/element/element.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/completion/dart/completion_manager_test.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/completion_manager_test.dart b/pkg/analysis_server/test/services/completion/dart/completion_manager_test.dart
index 2ee39fb3e2fb79b44ece1ab6f8356341dc2f061c..462d7872ff61959dae9b039e5d70b900714b27eb 100644
--- a/pkg/analysis_server/test/services/completion/dart/completion_manager_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/completion_manager_test.dart
@@ -67,10 +67,16 @@ part '$testFile';
expect(imports, hasLength(directives.length + 1));
ImportElement importNamed(String expectedUri) {
- return imports.firstWhere((elem) => elem.uri == expectedUri, orElse: () {
- var importedNames = imports.map((elem) => elem.uri);
- fail('Failed to find $expectedUri in $importedNames');
- });
+ List<String> uriList = <String>[];
+ for (ImportElement importElement in imports) {
+ String uri = importElement.importedLibrary.source.uri.toString();
+ uriList.add(uri);
+ if (uri.endsWith(expectedUri)) {
+ return importElement;
+ }
+ }
+ fail('Failed to find $expectedUri in $uriList');
+ return null;
}
void assertImportedLib(String expectedUri) {
@@ -79,7 +85,7 @@ part '$testFile';
}
// Assert that the new imports each have an export namespace
- assertImportedLib(null /* dart:core */);
- assertImportedLib('/libA.dart');
+ assertImportedLib('dart:core');
+ assertImportedLib('libA.dart');
}
}
« no previous file with comments | « pkg/analysis_server/lib/src/status/element_writer.dart ('k') | pkg/analyzer/lib/dart/element/element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698