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()); |