| Index: packages/path/test/posix_test.dart
|
| diff --git a/packages/path/test/posix_test.dart b/packages/path/test/posix_test.dart
|
| index 2368d9992b465ccc40728242bf1c7d9df74b7834..afd6b94f03d0ccb93670705bddee360a1e56ec74 100644
|
| --- a/packages/path/test/posix_test.dart
|
| +++ b/packages/path/test/posix_test.dart
|
| @@ -4,7 +4,7 @@
|
|
|
| library path.test.posix_test;
|
|
|
| -import 'package:unittest/unittest.dart';
|
| +import 'package:test/test.dart';
|
| import 'package:path/path.dart' as path;
|
|
|
| import 'utils.dart';
|
| @@ -419,6 +419,19 @@ main() {
|
| expect(context.isWithin('baz', '/root/path/bang/baz'), 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('foo/bar', 'foo/bar/baz/..'), isFalse);
|
| + expect(context.isWithin('foo/bar', 'foo/bar/baz/../qux'), isTrue);
|
| + });
|
| +
|
| test('from a relative root', () {
|
| var r = new path.Context(style: path.Style.posix, current: 'foo/bar');
|
| expect(r.isWithin('.', 'a/b/c'), isTrue);
|
|
|