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

Unified Diff: pkg/path/test/url_test.dart

Issue 203673003: Allow [path.fromUri] to take a string as well as a URI. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 9 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/path/test/posix_test.dart ('k') | pkg/path/test/windows_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/path/test/url_test.dart
diff --git a/pkg/path/test/url_test.dart b/pkg/path/test/url_test.dart
index e149b4f0e22dadb0795591860aedaa5781d73c41..58c7b929a6e235b1421504294c5b237b6dd95763 100644
--- a/pkg/path/test/url_test.dart
+++ b/pkg/path/test/url_test.dart
@@ -700,20 +700,28 @@ main() {
expect(context.withoutExtension('a/b.c//'), 'a/b//');
});
- test('fromUri', () {
- expect(context.fromUri(Uri.parse('http://dartlang.org/path/to/foo')),
- 'http://dartlang.org/path/to/foo');
- expect(context.fromUri(Uri.parse('http://dartlang.org/path/to/foo/')),
- 'http://dartlang.org/path/to/foo/');
- expect(context.fromUri(Uri.parse('file:///path/to/foo')),
- 'file:///path/to/foo');
- expect(context.fromUri(Uri.parse('foo/bar')), 'foo/bar');
- expect(context.fromUri(Uri.parse('http://dartlang.org/path/to/foo%23bar')),
- 'http://dartlang.org/path/to/foo%23bar');
- // Since the resulting "path" is also a URL, special characters should
- // remain percent-encoded in the result.
- expect(context.fromUri(Uri.parse('_%7B_%7D_%60_%5E_%20_%22_%25_')),
- r'_%7B_%7D_%60_%5E_%20_%22_%25_');
+ group('fromUri', () {
+ test('with a URI', () {
+ expect(context.fromUri(Uri.parse('http://dartlang.org/path/to/foo')),
+ 'http://dartlang.org/path/to/foo');
+ expect(context.fromUri(Uri.parse('http://dartlang.org/path/to/foo/')),
+ 'http://dartlang.org/path/to/foo/');
+ expect(context.fromUri(Uri.parse('file:///path/to/foo')),
+ 'file:///path/to/foo');
+ expect(context.fromUri(Uri.parse('foo/bar')), 'foo/bar');
+ expect(context.fromUri(
+ Uri.parse('http://dartlang.org/path/to/foo%23bar')),
+ 'http://dartlang.org/path/to/foo%23bar');
+ // Since the resulting "path" is also a URL, special characters should
+ // remain percent-encoded in the result.
+ expect(context.fromUri(Uri.parse('_%7B_%7D_%60_%5E_%20_%22_%25_')),
+ r'_%7B_%7D_%60_%5E_%20_%22_%25_');
+ });
+
+ test('with a string', () {
+ expect(context.fromUri('http://dartlang.org/path/to/foo'),
+ 'http://dartlang.org/path/to/foo');
+ });
});
test('toUri', () {
« no previous file with comments | « pkg/path/test/posix_test.dart ('k') | pkg/path/test/windows_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698