| Index: test/windows_test.dart
|
| diff --git a/test/windows_test.dart b/test/windows_test.dart
|
| index a32f1fec15458f96a2f6f02b6fe3f10cb91a0494..1bcad510ab3fb5cd3b8eaff3df38483b09476dfa 100644
|
| --- a/test/windows_test.dart
|
| +++ b/test/windows_test.dart
|
| @@ -537,6 +537,28 @@ main() {
|
| expect(context.isWithin(r'baz', r'C:\root\path\bang\baz'), isFalse);
|
| });
|
|
|
| + test('complex cases', () {
|
| + expect(context.isWithin(r'foo\.\bar', r'foo\bar\baz'), isTrue);
|
| + expect(context.isWithin(r'foo\\bar', r'foo\bar\baz'), isTrue);
|
| + expect(context.isWithin(r'foo\qux\..\bar', r'foo\bar\baz'), isTrue);
|
| + expect(context.isWithin(r'foo\bar', r'foo\bar\baz\..\..'), isFalse);
|
| + expect(context.isWithin(r'foo\bar', r'foo\bar\\\'), isFalse);
|
| + expect(context.isWithin(r'foo\.bar', r'foo\.bar\baz'), isTrue);
|
| + expect(context.isWithin(r'foo\.\bar', r'foo\.bar\baz'), isFalse);
|
| + expect(context.isWithin(r'foo\..bar', r'foo\..bar\baz'), isTrue);
|
| + expect(context.isWithin(r'C:\', 'C:/foo'), isTrue);
|
| + expect(context.isWithin(r'C:\', r'D:\foo'), isFalse);
|
| + expect(context.isWithin(r'C:\', r'\\foo\bar'), isFalse);
|
| + });
|
| +
|
| + test('with root-relative paths', () {
|
| + expect(context.isWithin(r'\foo', r'C:\foo\bar'), isTrue);
|
| + expect(context.isWithin(r'C:\foo', r'\foo\bar'), isTrue);
|
| + expect(context.isWithin(r'\root', r'foo\bar'), isTrue);
|
| + expect(context.isWithin(r'foo', r'\root\path\foo\bar'), isTrue);
|
| + expect(context.isWithin(r'\foo', r'\foo\bar'), isTrue);
|
| + });
|
| +
|
| test('from a relative root', () {
|
| var r = new path.Context(style: path.Style.windows, current: r'foo\bar');
|
| expect(r.isWithin('.', r'a\b\c'), isTrue);
|
|
|