Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Side by Side Diff: pkg/glob/test/parse_test.dart

Issue 533323003: Fix glob match and parse tests for Windows and URL styles. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/glob/test/match_test.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
7 8
8 void main() { 9 void main() {
9 test("supports backslash-escaped characters", () { 10 test("supports backslash-escaped characters", () {
10 expect(r"\*[]{,}?()", contains(new Glob(r"\\\*\[\]\{\,\}\?\(\)"))); 11 expect(r"\*[]{,}?()", contains(new Glob(r"\\\*\[\]\{\,\}\?\(\)")));
12 if (p.style != p.Style.windows) {
13 expect(r"foo\bar", contains(new Glob(r"foo\\bar")));
14 }
11 }); 15 });
12 16
13 test("disallows an empty glob", () { 17 test("disallows an empty glob", () {
14 expect(() => new Glob(""), throwsFormatException); 18 expect(() => new Glob(""), throwsFormatException);
15 }); 19 });
16 20
17 group("range", () { 21 group("range", () {
18 test("supports either ^ or ! for negated ranges", () { 22 test("supports either ^ or ! for negated ranges", () {
19 var bang = new Glob("fo[!a-z]"); 23 var bang = new Glob("fo[!a-z]");
20 expect("foo", isNot(contains(bang))); 24 expect("foo", isNot(contains(bang)));
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 test("disallows dangling ] in options", () { 87 test("disallows dangling ] in options", () {
84 expect(() => new Glob(r"{abc]}"), throwsFormatException); 88 expect(() => new Glob(r"{abc]}"), throwsFormatException);
85 }); 89 });
86 }); 90 });
87 91
88 test("disallows unescaped parens", () { 92 test("disallows unescaped parens", () {
89 expect(() => new Glob("foo(bar"), throwsFormatException); 93 expect(() => new Glob("foo(bar"), throwsFormatException);
90 expect(() => new Glob("foo)bar"), throwsFormatException); 94 expect(() => new Glob("foo)bar"), throwsFormatException);
91 }); 95 });
92 } 96 }
OLDNEW
« no previous file with comments | « pkg/glob/test/match_test.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698