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

Side by Side Diff: test/glob_test.dart

Issue 1491003002: Add a caseSensitive flag to new Glob(). (Closed) Base URL: git@github.com:dart-lang/glob@master
Patch Set: Code review changes Created 5 years 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
« no previous file with comments | « pubspec.yaml ('k') | test/list_test.dart » ('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:test/test.dart'; 6 import 'package:test/test.dart';
7 7
8 void main() { 8 void main() {
9 group("Glob.quote()", () { 9 group("Glob.quote()", () {
10 test("quotes all active characters", () { 10 test("quotes all active characters", () {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 expect(match.groups([0]), equals(["foobar"])); 84 expect(match.groups([0]), equals(["foobar"]));
85 }); 85 });
86 86
87 test("throws a range error for an invalid group", () { 87 test("throws a range error for an invalid group", () {
88 expect(() => match[1], throwsRangeError); 88 expect(() => match[1], throwsRangeError);
89 expect(() => match[-1], throwsRangeError); 89 expect(() => match[-1], throwsRangeError);
90 expect(() => match.group(1), throwsRangeError); 90 expect(() => match.group(1), throwsRangeError);
91 expect(() => match.groups([1]), throwsRangeError); 91 expect(() => match.groups([1]), throwsRangeError);
92 }); 92 });
93 }); 93 });
94
95 test("globs are case-sensitive by default for Posix and URL contexts", () {
96 expect("foo", contains(new Glob("foo", context: p.posix)));
97 expect("FOO", isNot(contains(new Glob("foo", context: p.posix))));
98 expect("foo", isNot(contains(new Glob("FOO", context: p.posix))));
99
100 expect("foo", contains(new Glob("foo", context: p.url)));
101 expect("FOO", isNot(contains(new Glob("foo", context: p.url))));
102 expect("foo", isNot(contains(new Glob("FOO", context: p.url))));
103 });
104
105 test("globs are case-insensitive by default for Windows contexts", () {
106 expect("foo", contains(new Glob("foo", context: p.windows)));
107 expect("FOO", contains(new Glob("foo", context: p.windows)));
108 expect("foo", contains(new Glob("FOO", context: p.windows)));
109 });
94 } 110 }
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | test/list_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698