OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'package:glob/glob.dart'; | 5 import 'package:glob/glob.dart'; |
6 import 'package:path/path.dart' as p; | 6 import 'package:path/path.dart' as p; |
7 import 'package:unittest/unittest.dart'; | 7 import 'package:test/test.dart'; |
8 | 8 |
9 void main() { | 9 void main() { |
10 test("supports backslash-escaped characters", () { | 10 test("supports backslash-escaped characters", () { |
11 expect(r"*[]{,}?()", contains(new Glob(r"\*\[\]\{\,\}\?\(\)"))); | 11 expect(r"*[]{,}?()", contains(new Glob(r"\*\[\]\{\,\}\?\(\)"))); |
12 if (p.style != p.Style.windows) { | 12 if (p.style != p.Style.windows) { |
13 expect(r"foo\bar", contains(new Glob(r"foo\\bar"))); | 13 expect(r"foo\bar", contains(new Glob(r"foo\\bar"))); |
14 } | 14 } |
15 }); | 15 }); |
16 | 16 |
17 test("disallows an empty glob", () { | 17 test("disallows an empty glob", () { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 test("disallows dangling ] in options", () { | 87 test("disallows dangling ] in options", () { |
88 expect(() => new Glob(r"{abc]}"), throwsFormatException); | 88 expect(() => new Glob(r"{abc]}"), throwsFormatException); |
89 }); | 89 }); |
90 }); | 90 }); |
91 | 91 |
92 test("disallows unescaped parens", () { | 92 test("disallows unescaped parens", () { |
93 expect(() => new Glob("foo(bar"), throwsFormatException); | 93 expect(() => new Glob("foo(bar"), throwsFormatException); |
94 expect(() => new Glob("foo)bar"), throwsFormatException); | 94 expect(() => new Glob("foo)bar"), throwsFormatException); |
95 }); | 95 }); |
96 } | 96 } |
OLD | NEW |