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

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

Issue 17265003: Avoid double-// on directory listing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
« sdk/lib/io/directory_impl.dart ('K') | « sdk/lib/io/directory_impl.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/directory_test.dart
diff --git a/tests/standalone/io/directory_test.dart b/tests/standalone/io/directory_test.dart
index 659228114cabf43f9d16bd19ec22687736403a66..f9927d39852065d55feabdea5e5da14f25181901 100644
--- a/tests/standalone/io/directory_test.dart
+++ b/tests/standalone/io/directory_test.dart
@@ -85,6 +85,24 @@ class DirectoryTest {
Expect.isFalse(listedFile);
}
+ static void testListingTailingPaths() {
+ Directory directory = new Directory("").createTempSync();
+ Directory subDirectory = new Directory("${directory.path}/subdir/");
+ subDirectory.createSync();
+ File f = new File('${subDirectory.path}/file.txt');
+ f.createSync();
+
+ void test(entry) {
+ Expect.isFalse(entry.path.contains(new RegExp('[\\/][\\/]')));
+ }
+
+ subDirectory.listSync().forEach(test);
+
+ subDirectory.list().listen(test, onDone: () {
+ directory.deleteSync(recursive: true);
+ });
+ }
+
static void testListNonExistent() {
setupListerHandlers(Stream<FileSystemEntity> stream) {
stream.listen(
@@ -397,6 +415,7 @@ class DirectoryTest {
static void testMain() {
testListing();
+ testListingTailingPaths();
testListNonExistent();
testListTooLongName();
testDeleteNonExistent();
« sdk/lib/io/directory_impl.dart ('K') | « sdk/lib/io/directory_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698