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

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: Address comments, move tests that fail on Windows due to VM bug 7157 to a separate test file. 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
« no previous file with comments | « tests/standalone/io/directory_test.dart ('k') | tests/standalone/standalone.status » ('j') | 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..361f7e6eba02085342865ee5cefc6d6bd9b5c885 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 = [];
+ 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 = [];
« no previous file with comments | « tests/standalone/io/directory_test.dart ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698