Index: tests/standalone/io/directory_test.dart |
diff --git a/tests/standalone/io/directory_test.dart b/tests/standalone/io/directory_test.dart |
index baf506efc5ea7c607923fd7de5e67a92d357f54c..825cb9cf285386222808f9b994fc0ae291275395 100644 |
--- a/tests/standalone/io/directory_test.dart |
+++ b/tests/standalone/io/directory_test.dart |
@@ -22,6 +22,31 @@ class DirectoryTest { |
Expect.isFalse(f.existsSync()); |
f.createSync(); |
+ void testSyncListing(bool recursive) { |
+ for (var entry in directory.listSync(recursive: recursive)) { |
+ if (entry is File) { |
+ Expect.isTrue(entry.name.contains(directory.path)); |
+ Expect.isTrue(entry.name.contains('subdir')); |
+ Expect.isTrue(entry.name.contains('file.txt')); |
+ Expect.isFalse(listedFile); |
+ listedFile = true; |
+ } else { |
+ Expect.isTrue(entry is Directory); |
+ Expect.isTrue(entry.path.contains(directory.path)); |
+ Expect.isTrue(entry.path.contains('subdir')); |
+ Expect.isFalse(listedDir); |
+ listedDir = true; |
+ } |
+ } |
+ Expect.equals(listedFile, recursive); |
+ Expect.isTrue(listedDir); |
+ listedFile = false; |
+ listedDir = false; |
+ } |
+ |
+ testSyncListing(true); |
+ testSyncListing(false); |
+ |
var lister = directory.list(recursive: true); |
lister.onDir = (dir) { |