Chromium Code Reviews| Index: pkg/pathos/test/pathos_posix_test.dart |
| diff --git a/pkg/pathos/test/pathos_posix_test.dart b/pkg/pathos/test/pathos_posix_test.dart |
| index ecdd1336ba3c39eac02bc4fda3edb9d663cf0121..d0b3b94b749af9f441fce07859d30480485db6b7 100644 |
| --- a/pkg/pathos/test/pathos_posix_test.dart |
| +++ b/pkg/pathos/test/pathos_posix_test.dart |
| @@ -399,4 +399,20 @@ main() { |
| expect(builder.withoutExtension('a/b.c/'), 'a/b/'); |
| expect(builder.withoutExtension('a/b.c//'), 'a/b//'); |
| }); |
| + |
| + test('fromUri', () { |
| + expect(builder.fromUri(Uri.parse('file:///path/to/foo')), '/path/to/foo'); |
| + expect(builder.fromUri(Uri.parse('file:///')), '/'); |
| + expect(builder.fromUri(Uri.parse('foo/bar')), 'foo/bar'); |
| + expect(builder.fromUri(Uri.parse('/path/to/foo')), '/path/to/foo'); |
| + expect(builder.fromUri(Uri.parse('///path/to/foo')), '/path/to/foo'); |
| + expect(() => builder.fromUri(Uri.parse('http://dartlang.org')), |
| + throwsArgumentError); |
| + }); |
| + |
| + test('toUri', () { |
| + expect(builder.toUri('/path/to/foo'), Uri.parse('file:///path/to/foo')); |
| + expect(builder.toUri('/'), Uri.parse('file:///')); |
| + expect(builder.toUri('foo/bar'), Uri.parse('foo/bar')); |
|
Bob Nystrom
2013/06/13 00:21:18
This feels odd to me. Will users expect this, or s
nweiz
2013/06/19 00:50:27
I think this is correct. Think about it from the p
|
| + }); |
| } |