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 fd8363a90a101dad3ac9e341d88eea44605b8316..8053b8505a6e88809e6e577dd95a700a03376445 100644 |
--- a/runtime/tests/vm/dart/hello_fuchsia_test.dart |
+++ b/runtime/tests/vm/dart/hello_fuchsia_test.dart |
@@ -412,6 +412,25 @@ void testPlatformEnvironment() { |
} |
} |
+Future testCopy() async { |
+ final String sourceName = "foo"; |
+ final String destName = "bar"; |
+ Directory tmp = await Directory.systemTemp.createTemp("testCopy"); |
+ File sourceFile = new File("${tmp.path}/$sourceName"); |
+ File destFile = new File("${tmp.path}/$destName"); |
+ List<int> data = new List<int>.generate(10 * 1024, (int i) => i & 0xff); |
+ await sourceFile.writeAsBytes(data); |
+ await sourceFile.copy(destFile.path); |
+ List<int> resultData = await destFile.readAsBytes(); |
+ assert(data.length == resultData.length); |
+ for (int i = 0; i < data.length; i++) { |
+ assert(data[i] == resultData[i]); |
+ } |
+ await sourceFile.delete(); |
+ await destFile.delete(); |
+ await tmp.delete(); |
+} |
+ |
main() async { |
print("Hello, Fuchsia!"); |
@@ -459,5 +478,9 @@ main() async { |
testProcessRunSync(); |
print("testProcessRunSync done"); |
+ print("testCopy"); |
+ await testCopy(); |
+ print("testCopy done"); |
+ |
print("Goodbyte, Fuchsia!"); |
} |