OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 | 6 |
7 testNormalRethrow() { | 7 testNormalRethrow() { |
8 var x = 0; | 8 var x = 0; |
9 try { | 9 try { |
10 try { | 10 try { |
11 throw x++; | 11 throw x++; |
12 } catch (e) { | 12 } catch (e) { |
13 Expect.isTrue(e == 0); | 13 Expect.isTrue(e == 0); |
14 x++; | 14 x++; |
15 rethrow; | 15 rethrow; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 x++; | 58 x++; |
59 } | 59 } |
60 Expect.isTrue(x == 5); | 60 Expect.isTrue(x == 5); |
61 } | 61 } |
62 | 62 |
63 main() { | 63 main() { |
64 testNormalRethrow(); | 64 testNormalRethrow(); |
65 testNormalRethrow2(); | 65 testNormalRethrow2(); |
66 testRethrowWithinTryRethrow(); | 66 testRethrowWithinTryRethrow(); |
67 } | 67 } |
OLD | NEW |