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

Unified Diff: pkg/pathos/test/pathos_url_test.dart

Issue 16848002: Add toUri and fromUri functions to pathos. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Preserve trailing separators. Created 7 years, 6 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/pathos/test/pathos_posix_test.dart ('k') | pkg/pathos/test/pathos_windows_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/pathos/test/pathos_url_test.dart
diff --git a/pkg/pathos/test/pathos_url_test.dart b/pkg/pathos/test/pathos_url_test.dart
index b8c100f27afe4613a573dadec3824b86b2ee1f69..ff1af8621bcb757678f57378d5aab523e0573642 100644
--- a/pkg/pathos/test/pathos_url_test.dart
+++ b/pkg/pathos/test/pathos_url_test.dart
@@ -625,4 +625,29 @@ main() {
expect(builder.withoutExtension('a/b.c/'), 'a/b/');
expect(builder.withoutExtension('a/b.c//'), 'a/b//');
});
+
+
+ test('fromUri', () {
+ expect(builder.fromUri(Uri.parse('http://dartlang.org/path/to/foo')),
+ 'http://dartlang.org/path/to/foo');
+ expect(builder.fromUri(Uri.parse('http://dartlang.org/path/to/foo/')),
+ 'http://dartlang.org/path/to/foo/');
+ expect(builder.fromUri(Uri.parse('file:///path/to/foo')),
+ 'file:///path/to/foo');
+ expect(builder.fromUri(Uri.parse('foo/bar')), 'foo/bar');
+ expect(builder.fromUri(Uri.parse('http://dartlang.org/path/to/foo%23bar')),
+ 'http://dartlang.org/path/to/foo%23bar');
+ });
+
+ test('toUri', () {
+ expect(builder.toUri('http://dartlang.org/path/to/foo'),
+ Uri.parse('http://dartlang.org/path/to/foo'));
+ expect(builder.toUri('http://dartlang.org/path/to/foo/'),
+ Uri.parse('http://dartlang.org/path/to/foo/'));
+ expect(builder.toUri('file:///path/to/foo'),
+ Uri.parse('file:///path/to/foo'));
+ expect(builder.toUri('foo/bar'), Uri.parse('foo/bar'));
+ expect(builder.toUri('http://dartlang.org/path/to/foo%23bar'),
+ Uri.parse('http://dartlang.org/path/to/foo%23bar'));
+ });
}
« no previous file with comments | « pkg/pathos/test/pathos_posix_test.dart ('k') | pkg/pathos/test/pathos_windows_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698