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

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

Issue 10414046: Add support for directory renaming to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments Created 8 years, 7 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
« no previous file with comments | « tests/standalone/io/directory_error_test.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 88e7b1af746b31deeaf95b83b9d9edf93fc4373e..139c8692f0bde607ec8c3810294f2114ec3b6d9e 100644
--- a/tests/standalone/io/directory_test.dart
+++ b/tests/standalone/io/directory_test.dart
@@ -407,9 +407,30 @@ testCreateTempError() {
}
+testRename() {
+ var d = new Directory('');
+ var temp1 = d.createTempSync();
+ var temp2 = d.createTempSync();
+ var temp3 = temp1.renameSync(temp2.path);
+ Expect.isFalse(temp1.existsSync());
+ Expect.isTrue(temp2.existsSync());
+ Expect.equals(temp3.path, temp2.path);
+
+ temp2.rename(temp1.path).then((temp4) {
+ Expect.isFalse(temp3.existsSync());
+ Expect.isFalse(temp2.existsSync());
+ Expect.isTrue(temp1.existsSync());
+ Expect.isTrue(temp4.existsSync());
+ Expect.equals(temp1.path, temp4.path);
+ temp1.deleteRecursivelySync();
+ });
+}
+
+
main() {
DirectoryTest.testMain();
NestedTempDirectoryTest.testMain();
testCreateTempErrorSync();
testCreateTempError();
+ testRename();
}
« no previous file with comments | « tests/standalone/io/directory_error_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698