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

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

Issue 23702037: Fix error handling when current working directory is deleted. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix type of _Directory._current Created 7 years, 3 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/directory_impl.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_chdir_test.dart
diff --git a/tests/standalone/io/directory_chdir_test.dart b/tests/standalone/io/directory_chdir_test.dart
index e1c9a1d14ad24a4a71c3c503a904a10478f4cf8a..682698fd424ab6c444f1bcd9d8d1a9ea6cc237de 100644
--- a/tests/standalone/io/directory_chdir_test.dart
+++ b/tests/standalone/io/directory_chdir_test.dart
@@ -26,8 +26,15 @@ testChangeDirectory() {
Directory.current = "..";
Expect.isTrue(new File("111").existsSync());
Expect.isTrue(new File("222/333").existsSync());
+ // Deleting the current working directory causes an error.
+ // On Windows, the deletion fails, and on non-Windows, the getter fails.
+ Expect.throws(() {
+ temp.deleteSync(recursive: true);
+ Directory.current;
+ }, (e) => e is DirectoryException);
Directory.current = initialCurrent;
- temp.deleteSync(recursive: true);
+ Directory.current;
+ if (temp.existsSync()) temp.deleteSync(recursive: true);
asyncEnd();
});
}
« no previous file with comments | « sdk/lib/io/directory_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698