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

Unified Diff: tests/standalone/io/file_system_links_test.dart

Issue 11748017: Add synchronous directory listing to dart:io Directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Avoid memory leak of DirectorySyncLister. Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
« runtime/bin/directory.cc ('K') | « tests/standalone/io/directory_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/file_system_links_test.dart
diff --git a/tests/standalone/io/file_system_links_test.dart b/tests/standalone/io/file_system_links_test.dart
index 856416e147c528aa36da6941d454b92002d2f12f..a18665f8addf8d6ea0b1d5e215774941aa3295bb 100644
--- a/tests/standalone/io/file_system_links_test.dart
+++ b/tests/standalone/io/file_system_links_test.dart
@@ -127,6 +127,21 @@ testDirectoryListing() {
createLink(temp2.path, y, true, () {
var files = [];
var dirs = [];
+ for (var entry in temp.listSync(recursive:true)) {
+ if (entry is File) {
+ files.add(entry.name);
+ } else {
+ Expect.isTrue(entry is Directory);
+ dirs.add(entry.path);
+ }
+ }
+ Expect.equals(1, files.length);
+ Expect.isTrue(files[0].endsWith(x));
+ Expect.equals(1, dirs.length);
+ Expect.isTrue(dirs[0].endsWith(y));
+ files = [];
Mads Ager (google) 2013/01/04 10:00:25 Add an empty line before resetting files and dirs
Bill Hesse 2013/01/04 13:49:27 Done.
+ dirs = [];
+
var lister = temp.list(recursive: true);
lister.onFile = (f) => files.add(f);
lister.onDir = (d) => dirs.add(d);
@@ -150,6 +165,8 @@ testDirectoryListingBrokenLink() {
var doesNotExist = 'this_thing_does_not_exist';
new File(x).createSync();
createLink(doesNotExist, link, true, () {
+ Expect.throws(() => temp.listSync(recursive: true),
+ (e) => e is DirectoryIOException);
var files = [];
var dirs = [];
var errors = [];
« runtime/bin/directory.cc ('K') | « tests/standalone/io/directory_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698