Index: runtime/tests/vm/dart/hello_fuchsia_test.dart |
diff --git a/runtime/tests/vm/dart/hello_fuchsia_test.dart b/runtime/tests/vm/dart/hello_fuchsia_test.dart |
index eb2aaf49b255e9d2e19f1b0e6cc258d9894c0cdd..8d597f2778cc70b299f964604218b042ec55d3cb 100644 |
--- a/runtime/tests/vm/dart/hello_fuchsia_test.dart |
+++ b/runtime/tests/vm/dart/hello_fuchsia_test.dart |
@@ -442,6 +442,28 @@ Future testCopy() async { |
await tmp.delete(); |
} |
+Future testRecursiveDelete() async { |
+ Directory tmp0 = await Directory.systemTemp.createTemp("testRD"); |
+ Directory tmp1 = await tmp0.createTemp("testRD"); |
+ Directory tmp2 = await tmp1.createTemp("testRD"); |
+ File file0 = new File("${tmp0.path}/file"); |
+ File file1 = new File("${tmp1.path}/file"); |
+ File file2 = new File("${tmp2.path}/file"); |
+ List<int> data = new List<int>.generate(10 * 1024, (int i) => i & 0xff); |
+ await file0.writeAsBytes(data); |
+ await file1.writeAsBytes(data); |
+ await file2.writeAsBytes(data); |
+ |
+ await tmp0.delete(recursive: true); |
+ |
+ assert(!await file2.exists()); |
+ assert(!await file1.exists()); |
+ assert(!await file0.exists()); |
+ assert(!await tmp2.exists()); |
+ assert(!await tmp1.exists()); |
+ assert(!await tmp0.exists()); |
+} |
+ |
main(List<String> args) async { |
if (args.length >= 1) { |
if (args[0] == "infinite-loop") { |
@@ -503,5 +525,9 @@ main(List<String> args) async { |
await testCopy(); |
print("testCopy done"); |
+ print("testRecursiveDelete"); |
+ await testRecursiveDelete(); |
+ print("testRecursiveDelete done"); |
+ |
print("Goodbyte, Fuchsia!"); |
} |