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

Unified Diff: pkg/path/test/posix_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: 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
Index: pkg/path/test/posix_test.dart
diff --git a/pkg/path/test/posix_test.dart b/pkg/path/test/posix_test.dart
index 83a473e78087dc3119151529329c5ccab499b3fa..72cfaf69f6470139d11980cd70e795e0bb6e33db 100644
--- a/pkg/path/test/posix_test.dart
+++ b/pkg/path/test/posix_test.dart
@@ -474,19 +474,25 @@ main() {
expect(context.withoutExtension('a/b.c//'), 'a/b//');
});
- test('fromUri', () {
- expect(context.fromUri(Uri.parse('file:///path/to/foo')), '/path/to/foo');
- expect(context.fromUri(Uri.parse('file:///path/to/foo/')), '/path/to/foo/');
- expect(context.fromUri(Uri.parse('file:///')), '/');
- expect(context.fromUri(Uri.parse('foo/bar')), 'foo/bar');
- expect(context.fromUri(Uri.parse('/path/to/foo')), '/path/to/foo');
- expect(context.fromUri(Uri.parse('///path/to/foo')), '/path/to/foo');
- expect(context.fromUri(Uri.parse('file:///path/to/foo%23bar')),
- '/path/to/foo#bar');
- expect(context.fromUri(Uri.parse('_%7B_%7D_%60_%5E_%20_%22_%25_')),
- r'_{_}_`_^_ _"_%_');
- expect(() => context.fromUri(Uri.parse('http://dartlang.org')),
- throwsArgumentError);
+ group('fromUri', () {
+ test('with a URI', () {
+ expect(context.fromUri(Uri.parse('file:///path/to/foo')), '/path/to/foo');
+ expect(context.fromUri(Uri.parse('file:///path/to/foo/')), '/path/to/foo/');
Bob Nystrom 2014/03/18 20:31:09 Long line.
nweiz 2014/03/18 22:02:19 Done.
+ expect(context.fromUri(Uri.parse('file:///')), '/');
+ expect(context.fromUri(Uri.parse('foo/bar')), 'foo/bar');
+ expect(context.fromUri(Uri.parse('/path/to/foo')), '/path/to/foo');
+ expect(context.fromUri(Uri.parse('///path/to/foo')), '/path/to/foo');
+ expect(context.fromUri(Uri.parse('file:///path/to/foo%23bar')),
+ '/path/to/foo#bar');
+ expect(context.fromUri(Uri.parse('_%7B_%7D_%60_%5E_%20_%22_%25_')),
+ r'_{_}_`_^_ _"_%_');
+ expect(() => context.fromUri(Uri.parse('http://dartlang.org')),
+ throwsArgumentError);
+ });
+
+ test('with a string', () {
+ expect(context.fromUri('file:///path/to/foo'), '/path/to/foo');
+ });
});
test('toUri', () {

Powered by Google App Engine
This is Rietveld 408576698