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

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

Issue 13818010: dart:io | Ensure that Directory.list terminates even when symbolic links create loops in the file s… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add documentation of new behavior. Created 7 years, 8 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_linux.cc ('K') | « sdk/lib/io/directory.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/link_test.dart
diff --git a/tests/standalone/io/link_test.dart b/tests/standalone/io/link_test.dart
index a20d82c722a7a0c12e1716a8a229ae4e2cc8d046..e4ecfbe28ce0dff90215e4896ee7de0a6713ab85 100644
--- a/tests/standalone/io/link_test.dart
+++ b/tests/standalone/io/link_test.dart
@@ -137,7 +137,34 @@ testCreateSync() {
});
}
+testCreateLoopingLink() {
+ Path base = new Path(new Directory('').createTempSync().path);
+ new Directory.fromPath(base.append('a/b/c')).create(recursive: true)
+ .then((_) =>
+ new Link.fromPath(base.append('a/b/c/d'))
+ .create(base.append('a/b').toNativePath()))
+ .then((_) =>
+ new Link.fromPath(base.append('a/b/c/e'))
+ .create(base.append('a').toNativePath()))
+ .then((_) =>
+ new Directory.fromPath(base.append('a'))
+ .list(recursive: true,followLinks: false)
Søren Gjesse 2013/04/10 11:33:23 space after ,
Bill Hesse 2013/04/10 12:49:47 Done.
+ .last)
+ .then((_) =>
+ // This directory listing must terminate, even though it contains loops.
+ new Directory.fromPath(base.append('a'))
+ .list(recursive: true,followLinks: true)
Søren Gjesse 2013/04/10 11:33:23 ditto.
+ .last)
+ .then((_) =>
+ // This directory listing must terminate, even though it contains loops.
+ new Directory.fromPath(base.append('a/b/c'))
+ .list(recursive: true, followLinks: true)
+ .last)
+ .then((_) =>
+ new Directory.fromPath(base).delete(recursive: true));
+}
main() {
testCreateSync();
+ testCreateLoopingLink();
}
« runtime/bin/directory_linux.cc ('K') | « sdk/lib/io/directory.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698