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

Side by Side Diff: tests/kernel/unsorted/rethrow_test.dart

Issue 2451623006: Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork." (Closed)
Patch Set: Fix Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'expect.dart';
6
7 testNormalRethrow() {
8 var x = 0;
9 try {
10 try {
11 throw x++;
12 } catch (e) {
13 Expect.isTrue(e == 0);
14 x++;
15 rethrow;
16 }
17 } catch (e) {
18 Expect.isTrue(e == 0);
19 x++;
20 }
21 Expect.isTrue(x == 3);
22 }
23
24 testNormalRethrow2() {
25 var x = 0;
26 try {
27 try {
28 throw x++;
29 } on int catch (e) {
30 Expect.isTrue(e == 0);
31 x++;
32 rethrow;
33 }
34 } catch (e) {
35 Expect.isTrue(e == 0);
36 x++;
37 }
38 Expect.isTrue(x == 3);
39 }
40
41 testRethrowWithinTryRethrow() {
42 var x = 0;
43 try {
44 try {
45 throw x++;
46 } on int catch (e) {
47 Expect.isTrue(e == 0);
48 x++;
49 try {
50 x++;
51 rethrow;
52 } finally {
53 x++;
54 }
55 }
56 } catch (e) {
57 Expect.isTrue(e == 0);
58 x++;
59 }
60 Expect.isTrue(x == 5);
61 }
62
63 main() {
64 testNormalRethrow();
65 testNormalRethrow2();
66 testRethrowWithinTryRethrow();
67 }
OLDNEW
« no previous file with comments | « tests/kernel/unsorted/nullable_operator_test.dart ('k') | tests/kernel/unsorted/return_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698