| 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..a446f767e700cf37d739abf907b582e7800e2411 100644
|
| --- a/pkg/pathos/test/pathos_posix_test.dart
|
| +++ b/pkg/pathos/test/pathos_posix_test.dart
|
| @@ -399,4 +399,26 @@ 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:///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('file:///path/to/foo%23bar')),
|
| + '/path/to/foo#bar');
|
| + 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('/path/to/foo/'), Uri.parse('file:///path/to/foo/'));
|
| + expect(builder.toUri('/'), Uri.parse('file:///'));
|
| + expect(builder.toUri('foo/bar'), Uri.parse('foo/bar'));
|
| + expect(builder.toUri('/path/to/foo#bar'),
|
| + Uri.parse('file:///path/to/foo%23bar'));
|
| + });
|
| }
|
|
|