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

Unified Diff: pkg/analyzer/test/src/context/source_test.dart

Issue 2717933002: fix source restoreUri test (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/context/source_test.dart
diff --git a/pkg/analyzer/test/src/context/source_test.dart b/pkg/analyzer/test/src/context/source_test.dart
index dcb81ace602c95d90d7f65504c0d665cf00a9d3b..7d63c4575bd95a37f8089c03b27f72569a68a4bc 100644
--- a/pkg/analyzer/test/src/context/source_test.dart
+++ b/pkg/analyzer/test/src/context/source_test.dart
@@ -22,17 +22,23 @@ main() {
@reflectiveTest
class SourceFactoryImplTest extends AbstractContextTest {
void test_restoreUri() {
- Map<String, Uri> packageUriMap = <String, Uri>{
- 'foo': Uri.parse('file:///pkgs/somepkg/lib/')
- };
+ String libPath = resourceProvider.convertPath('/pkgs/somepkg/lib/');
+ Uri libUri = resourceProvider.getFolder(libPath).toUri();
+ Map<String, Uri> packageUriMap = <String, Uri>{'foo': libUri};
SourceFactoryImpl sourceFactory = new SourceFactoryImpl(
<UriResolver>[new ResourceUriResolver(resourceProvider)],
new _MockPackages(packageUriMap),
);
- Uri uri = sourceFactory.restoreUri(newSource('/pkgs/somepkg/lib'));
- // TODO(danrubel) fix on Windows
- if (resourceProvider.absolutePathContext.separator != r'\') {
+ Source libSource = newSource('/pkgs/somepkg/lib');
+ Uri uri = sourceFactory.restoreUri(libSource);
+ try {
expect(uri, Uri.parse('package:foo/'));
+ } catch (e) {
+ print('=== debug info ===');
+ print('libPath: $libPath');
+ print('libUri: $libUri');
+ print('libSource: ${libSource?.fullName}');
+ rethrow;
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698