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

Unified Diff: pkg/analyzer/test/src/util/fast_uri_test.dart

Issue 2523483002: Fix FastUri.resolveUri to handle cases like "/a.dart". (Closed)
Patch Set: Created 4 years, 1 month 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/test/src/summary/resynthesize_common.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/util/fast_uri_test.dart
diff --git a/pkg/analyzer/test/src/util/fast_uri_test.dart b/pkg/analyzer/test/src/util/fast_uri_test.dart
index 8ed7be6672d87db9e4152185a97fa6071b474f1b..f04dcb4841c6f6a8a913e24b08c47fe2d175f4a2 100644
--- a/pkg/analyzer/test/src/util/fast_uri_test.dart
+++ b/pkg/analyzer/test/src/util/fast_uri_test.dart
@@ -117,6 +117,17 @@ class _FastUriTest {
_compareUris(uri3, Uri.parse('package:analyzer/aaa/bbbb/dd/eeee.dart'));
}
+ void test_resolveUri_short_absolute() {
+ // Check the case where the URI being resolved is a "short absolute" uri
+ // (starts with a "/" but doesn't start with "file://"). Such URIs are not
+ // actually valid URIs but we still want to handle them in a way that's
+ // consistent with the behavior of Uri.
+ String containing = 'file:///foo/bar';
+ String relative = '/a.dart';
+ String expectedResult = Uri.parse(containing).resolve(relative).toString();
+ _checkResolveUri(containing, relative, expectedResult);
+ }
+
void _checkResolveUri(String srcText, String relText, String targetText) {
Uri src = FastUri.parse(srcText);
Uri rel = FastUri.parse(relText);
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_common.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698