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

Unified Diff: tests/standalone/io/windows_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: Fix memory leak. Improve OS error for Link.target of a non-link. 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
« runtime/bin/file_win.cc ('K') | « tests/standalone/io/link_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/windows_file_system_links_test.dart
diff --git a/tests/standalone/io/windows_file_system_links_test.dart b/tests/standalone/io/windows_file_system_links_test.dart
index a458a5f9e4095ed2823175ec0ce6518855b57b3f..f161b0e12aea5945dce03cb85b4c3bc0e929dace 100644
--- a/tests/standalone/io/windows_file_system_links_test.dart
+++ b/tests/standalone/io/windows_file_system_links_test.dart
@@ -26,6 +26,8 @@ testJunctionTypeDelete() {
FileSystemEntity.typeSync(y, followLinks: false));
Expect.equals(FileSystemEntityType.DIRECTORY,
FileSystemEntity.typeSync(x, followLinks: false));
+ Expect.equals(x, new Link(y).targetSync());
+
// Test Junction pointing to a missing directory.
new Directory(x).deleteSync();
Expect.isTrue(new Directory(y).existsSync());
@@ -42,12 +44,14 @@ testJunctionTypeDelete() {
FileSystemEntity.typeSync(y, followLinks: false));
Expect.equals(FileSystemEntityType.NOT_FOUND,
FileSystemEntity.typeSync(x, followLinks: false));
+ Expect.equals(x, new Link(y).targetSync());
// Delete Junction pointing to a missing directory.
new Directory(y).deleteSync();
Expect.isFalse(FileSystemEntity.isLinkSync(y));
Expect.equals(FileSystemEntityType.NOT_FOUND,
FileSystemEntity.typeSync(y));
+ Expect.throws(() => new Link(y).targetSync());
new Directory(x).createSync();
new Link(y).create(x).then((_) {
@@ -55,6 +59,7 @@ testJunctionTypeDelete() {
FileSystemEntity.typeSync(y, followLinks: false));
Expect.equals(FileSystemEntityType.DIRECTORY,
FileSystemEntity.typeSync(x, followLinks: false));
+ Expect.equals(x, new Link(y).targetSync());
// Delete Junction pointing to an existing directory.
new Directory(y).deleteSync();
@@ -66,6 +71,8 @@ testJunctionTypeDelete() {
FileSystemEntity.typeSync(x));
Expect.equals(FileSystemEntityType.DIRECTORY,
FileSystemEntity.typeSync(x, followLinks: false));
+ Expect.throws(() => new Link(y).targetSync());
+
temp.deleteSync(recursive: true);
});
});
« runtime/bin/file_win.cc ('K') | « tests/standalone/io/link_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698