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

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

Issue 10381150: Fix directory listing to actually have the semantics intended. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Windows part Created 8 years, 7 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 | « runtime/bin/directory_win.cc ('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 6f19a56d28fd26c9f68555389b8e6aec46cfc4f4..453ebb5fbda2327fead13d238ec7db5af3e57f85 100644
--- a/tests/standalone/io/file_system_links_test.dart
+++ b/tests/standalone/io/file_system_links_test.dart
@@ -143,6 +143,33 @@ testDirectoryListing() {
}
+testDirectoryListingBrokenLink() {
+ var temp = new Directory('').createTempSync();
+ var x = '${temp.path}${Platform.pathSeparator}x';
+ var link = '${temp.path}${Platform.pathSeparator}link';
+ var doesNotExist = 'this_thing_does_not_exist';
+ new File(x).createSync();
+ createLink(doesNotExist, link, true, () {
+ var files = [];
+ var dirs = [];
+ var errors = [];
+ var lister = temp.list(recursive: true);
+ lister.onFile = (f) => files.add(f);
+ lister.onDir = (d) => dirs.add(d);
+ lister.onError = (d) => errors.add(d);
+ lister.onDone = (success) {
+ Expect.isFalse(success);
+ Expect.equals(1, files.length);
+ Expect.isTrue(files[0].endsWith(x));
+ Expect.equals(0, dirs.length);
+ Expect.equals(1, errors.length);
+ Expect.isTrue(errors[0].toString().contains(link));
+ temp.deleteRecursivelySync();
+ };
+ });
+}
+
+
main() {
testFileExistsCreate();
testFileDelete();
@@ -150,4 +177,5 @@ main() {
testDirectoryExistsCreate();
testDirectoryDelete();
testDirectoryListing();
+ testDirectoryListingBrokenLink();
}
« no previous file with comments | « runtime/bin/directory_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698