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

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

Issue 23083002: dart:io | Add Link.update, and change Link.updateSync. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 | « sdk/lib/io/link.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/link_async_test.dart
diff --git a/tests/standalone/io/link_async_test.dart b/tests/standalone/io/link_async_test.dart
index 5826b3e843932e99e366e4ecb5b8040c7adde71b..d91074955cb77769337a4ad60819ea6d5adb24ad 100644
--- a/tests/standalone/io/link_async_test.dart
+++ b/tests/standalone/io/link_async_test.dart
@@ -181,6 +181,24 @@ Future testRename() {
.then((_) => Expect.isFalse(link2.existsSync()));
}
+ Future testUpdate(String base , String target1, String target2) {
+ Link link1;
+ return new Link(join(base, 'c')).create(target1)
+ .then((link) {
+ link1 = link;
+ Expect.isTrue(link1.existsSync());
+ return link1.update(target2);
+ })
+ .then((Link link) {
+ Expect.isTrue(link1.existsSync());
+ Expect.isTrue(link.existsSync());
+ return FutureExpect.equals(target2, link.target())
+ .then((_) => FutureExpect.equals(target2, link1.target()))
+ .then((_) => link.delete());
+ })
+ .then((_) => Expect.isFalse(link1.existsSync()));
+ }
+
return new Directory('').createTemp().then((baseDir) {
String base = baseDir.path;
var targetsFutures = [];
@@ -195,6 +213,7 @@ Future testRename() {
return Future.wait(targetsFutures).then((targets) {
return testRename(base, targets[0].path)
.then((_) => testRename(base, targets[1].path))
+ .then((_) => testUpdate(base, targets[0].path, targets[1].path))
.then((_) => baseDir.delete(recursive: true));
});
});
« no previous file with comments | « sdk/lib/io/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698