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

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

Issue 2710103002: [dart:io][windows] Set up CRT error handling behavior (Closed)
Patch Set: Created 3 years, 10 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 | « runtime/bin/platform_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/file_test.dart
diff --git a/tests/standalone/io/file_test.dart b/tests/standalone/io/file_test.dart
index 701add300ac493b2dce7a5a7928f0104c6c2326a..c80d60fe6312eb2026d7fad2b80aac0141f63e80 100644
--- a/tests/standalone/io/file_test.dart
+++ b/tests/standalone/io/file_test.dart
@@ -756,6 +756,17 @@ class FileTest {
Expect.equals(10, openedFile.lengthSync());
openedFile.truncateSync(5);
Expect.equals(5, openedFile.lengthSync());
+ bool exceptionCaught = false;
+ bool wrongExceptionCaught = false;
+ try {
+ openedFile.truncateSync(-5);
+ } on FileSystemException catch (ex) {
+ exceptionCaught = true;
+ } on Exception catch (ex) {
+ wrongExceptionCaught = true;
+ }
+ Expect.equals(true, exceptionCaught);
+ Expect.equals(true, !wrongExceptionCaught);
openedFile.closeSync();
file.deleteSync();
Expect.isFalse(file.existsSync());
« no previous file with comments | « runtime/bin/platform_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698