| Index: test/url_test.dart
|
| diff --git a/test/url_test.dart b/test/url_test.dart
|
| index 1188129f396924998191fe972cf1b2b3e925f487..5a5d57b111e4ede44c38d26aedb1b41f4440c205 100644
|
| --- a/test/url_test.dart
|
| +++ b/test/url_test.dart
|
| @@ -629,6 +629,29 @@ main() {
|
| isFalse);
|
| });
|
|
|
| + test('complex cases', () {
|
| + expect(context.isWithin('foo/./bar', 'foo/bar/baz'), isTrue);
|
| + expect(context.isWithin('foo//bar', 'foo/bar/baz'), isTrue);
|
| + expect(context.isWithin('foo/qux/../bar', 'foo/bar/baz'), isTrue);
|
| + expect(context.isWithin('foo/bar', 'foo/bar/baz/../..'), isFalse);
|
| + expect(context.isWithin('foo/bar', 'foo/bar///'), isFalse);
|
| + expect(context.isWithin('foo/.bar', 'foo/.bar/baz'), isTrue);
|
| + expect(context.isWithin('foo/./bar', 'foo/.bar/baz'), isFalse);
|
| + expect(context.isWithin('foo/..bar', 'foo/..bar/baz'), isTrue);
|
| + expect(context.isWithin('http://example.org/', 'http://example.com/foo'),
|
| + isFalse);
|
| + expect(context.isWithin('http://example.org/', 'http://dartlang.org/foo'),
|
| + isFalse);
|
| + });
|
| +
|
| + test('with root-relative paths', () {
|
| + expect(context.isWithin('/foo', 'http://dartlang.org/foo/bar'), isTrue);
|
| + expect(context.isWithin('http://dartlang.org/foo', '/foo/bar'), isTrue);
|
| + expect(context.isWithin('/root', 'foo/bar'), isTrue);
|
| + expect(context.isWithin('foo', '/root/path/foo/bar'), isTrue);
|
| + expect(context.isWithin('/foo', '/foo/bar'), isTrue);
|
| + });
|
| +
|
| test('from a relative root', () {
|
| var r = new path.Context(style: path.Style.url, current: 'foo/bar');
|
| expect(r.isWithin('.', 'a/b/c'), isTrue);
|
|
|