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

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

Issue 10891020: Update almost all tests (except co19) to use the new try-catch syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Created 8 years, 4 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 | « tests/standalone/io/file_invalid_arguments_test.dart ('k') | tests/standalone/io/fuzz_support.dart » ('j') | 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 fed6af6806cab434240a4d1d73ca60120d0f718f..5078f5fa184f9b60b9aa57218ae582cc6d3b332b 100644
--- a/tests/standalone/io/file_test.dart
+++ b/tests/standalone/io/file_test.dart
@@ -759,9 +759,9 @@ class FileTest {
openedFile.closeSync();
try {
openedFile.readByteSync();
- } catch (FileIOException ex) {
+ } on FileIOException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -769,9 +769,9 @@ class FileTest {
exceptionCaught = false;
try {
openedFile.writeByteSync(1);
- } catch (FileIOException ex) {
+ } on FileIOException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -779,9 +779,9 @@ class FileTest {
exceptionCaught = false;
try {
openedFile.writeStringSync("Test");
- } catch (FileIOException ex) {
+ } on FileIOException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -790,9 +790,9 @@ class FileTest {
try {
List<int> buffer = new List<int>(100);
openedFile.readListSync(buffer, 0, 10);
- } catch (FileIOException ex) {
+ } on FileIOException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -801,9 +801,9 @@ class FileTest {
try {
List<int> buffer = new List<int>(100);
openedFile.writeListSync(buffer, 0, 10);
- } catch (FileIOException ex) {
+ } on FileIOException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -811,9 +811,9 @@ class FileTest {
exceptionCaught = false;
try {
openedFile.positionSync();
- } catch (FileIOException ex) {
+ } on FileIOException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -821,9 +821,9 @@ class FileTest {
exceptionCaught = false;
try {
openedFile.lengthSync();
- } catch (FileIOException ex) {
+ } on FileIOException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -831,9 +831,9 @@ class FileTest {
exceptionCaught = false;
try {
openedFile.flushSync();
- } catch (FileIOException ex) {
+ } on FileIOException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -872,9 +872,9 @@ class FileTest {
try {
List<int> buffer = new List<int>(10);
openedFile.readListSync(buffer, 0, 12);
- } catch (IndexOutOfRangeException ex) {
+ } on IndexOutOfRangeException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -883,9 +883,9 @@ class FileTest {
try {
List<int> buffer = new List<int>(10);
openedFile.readListSync(buffer, 6, 6);
- } catch (IndexOutOfRangeException ex) {
+ } on IndexOutOfRangeException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -894,9 +894,9 @@ class FileTest {
try {
List<int> buffer = new List<int>(10);
openedFile.readListSync(buffer, -1, 1);
- } catch (IndexOutOfRangeException ex) {
+ } on IndexOutOfRangeException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -905,9 +905,9 @@ class FileTest {
try {
List<int> buffer = new List<int>(10);
openedFile.readListSync(buffer, 0, -1);
- } catch (IndexOutOfRangeException ex) {
+ } on IndexOutOfRangeException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -916,9 +916,9 @@ class FileTest {
try {
List<int> buffer = new List<int>(10);
openedFile.writeListSync(buffer, 0, 12);
- } catch (IndexOutOfRangeException ex) {
+ } on IndexOutOfRangeException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -927,9 +927,9 @@ class FileTest {
try {
List<int> buffer = new List<int>(10);
openedFile.writeListSync(buffer, 6, 6);
- } catch (IndexOutOfRangeException ex) {
+ } on IndexOutOfRangeException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -938,9 +938,9 @@ class FileTest {
try {
List<int> buffer = new List<int>(10);
openedFile.writeListSync(buffer, -1, 1);
- } catch (IndexOutOfRangeException ex) {
+ } on IndexOutOfRangeException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -949,9 +949,9 @@ class FileTest {
try {
List<int> buffer = new List<int>(10);
openedFile.writeListSync(buffer, 0, -1);
- } catch (IndexOutOfRangeException ex) {
+ } on IndexOutOfRangeException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -972,7 +972,7 @@ class FileTest {
try {
f.openSync();
Expect.fail("Expected exception opening directory as file");
- } catch (var e) {
+ } catch (e) {
Expect.isTrue(e is FileIOException);
}
}
« no previous file with comments | « tests/standalone/io/file_invalid_arguments_test.dart ('k') | tests/standalone/io/fuzz_support.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698