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

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

Issue 12812010: dart:io | Add Link.targetSync on all platforms. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Improve error handling on Windows. Created 7 years, 9 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
Index: tests/standalone/io/file_system_links_test.dart
diff --git a/tests/standalone/io/file_system_links_test.dart b/tests/standalone/io/file_system_links_test.dart
index d2e6796cb3d16a0b64a40a528fe3d46dab0bdb60..a1bd0af5480cef855b62261c3163379fb683b17f 100644
--- a/tests/standalone/io/file_system_links_test.dart
+++ b/tests/standalone/io/file_system_links_test.dart
@@ -26,6 +26,7 @@ testFileExistsCreate() {
FileSystemEntity.typeSync(y, followLinks: false));
Expect.equals(FileSystemEntityType.NOT_FOUND,
FileSystemEntity.typeSync(x, followLinks: false));
+ Expect.equals(x, new Link(y).targetSync());
new File(y).createSync();
Expect.isTrue(new File(y).existsSync());
@@ -40,6 +41,8 @@ testFileExistsCreate() {
FileSystemEntity.typeSync(y, followLinks: false));
Expect.equals(FileSystemEntityType.FILE,
FileSystemEntity.typeSync(x, followLinks: false));
+ Expect.equals(x, new Link(y).targetSync());
+
new File(x).deleteSync();
new Directory(x).createSync();
Expect.isTrue(FileSystemEntity.isLinkSync(y));
@@ -52,11 +55,14 @@ testFileExistsCreate() {
FileSystemEntity.typeSync(y, followLinks: false));
Expect.equals(FileSystemEntityType.DIRECTORY,
FileSystemEntity.typeSync(x, followLinks: false));
+ Expect.equals(x, new Link(y).targetSync());
+
new File(y).deleteSync();
Expect.isFalse(FileSystemEntity.isLinkSync(y));
Expect.isFalse(FileSystemEntity.isLinkSync(x));
Expect.equals(FileSystemEntityType.NOT_FOUND, FileSystemEntity.typeSync(y));
Expect.equals(FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(x));
+ Expect.throws(() => new Link(y).targetSync());
temp.deleteSync(recursive: true);
});

Powered by Google App Engine
This is Rietveld 408576698