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

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

Issue 725263002: Fix a bogus exception in Glob. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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/pubspec.yaml ('k') | no next file » | 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 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 import 'package:glob/glob.dart'; 8 import 'package:glob/glob.dart';
9 import 'package:glob/src/utils.dart'; 9 import 'package:glob/src/utils.dart';
10 import 'package:path/path.dart' as p; 10 import 'package:path/path.dart' as p;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 expect(schedule(() { 244 expect(schedule(() {
245 var pattern = separatorToForwardSlash( 245 var pattern = separatorToForwardSlash(
246 p.absolute(p.join(sandbox, 'foo/baz/**'))); 246 p.absolute(p.join(sandbox, 'foo/baz/**')));
247 247
248 return list(pattern); 248 return list(pattern);
249 }), completion(unorderedEquals([ 249 }), completion(unorderedEquals([
250 p.join("foo", "baz", "bang"), 250 p.join("foo", "baz", "bang"),
251 p.join("foo", "baz", "qux") 251 p.join("foo", "baz", "qux")
252 ]))); 252 ])));
253 }); 253 });
254
255 test("lists a subdirectory that sometimes exists", () {
256 d.dir("top", [
257 d.dir("dir1", [
258 d.dir("subdir", [d.file("file")])
259 ]),
260 d.dir("dir2", [])
261 ]).create();
262
263 expect(list("top/*/subdir/**"),
264 completion(equals([p.join("top", "dir1", "subdir", "file")])));
265 });
254 }); 266 });
255 } 267 }
256 268
257 typedef Future<List<String>> ListFn(String glob, 269 typedef Future<List<String>> ListFn(String glob,
258 {bool recursive, bool followLinks}); 270 {bool recursive, bool followLinks});
259 271
260 /// Runs [callback] in two groups with two values of [listFn]: one that uses 272 /// Runs [callback] in two groups with two values of [listFn]: one that uses
261 /// [Glob.list], one that uses [Glob.listSync]. 273 /// [Glob.list], one that uses [Glob.listSync].
262 void syncAndAsync(callback(ListFn listFn)) { 274 void syncAndAsync(callback(ListFn listFn)) {
263 group("async", () { 275 group("async", () {
(...skipping 28 matching lines...) Expand all
292 }, 'creating sandbox'); 304 }, 'creating sandbox');
293 305
294 currentSchedule.onComplete.schedule(() { 306 currentSchedule.onComplete.schedule(() {
295 d.defaultRoot = null; 307 d.defaultRoot = null;
296 if (sandbox == null) return null; 308 if (sandbox == null) return null;
297 var oldSandbox = sandbox; 309 var oldSandbox = sandbox;
298 sandbox = null; 310 sandbox = null;
299 return new Directory(oldSandbox).delete(recursive: true); 311 return new Directory(oldSandbox).delete(recursive: true);
300 }); 312 });
301 } 313 }
OLDNEW
« no previous file with comments | « pkg/glob/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698