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

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

Issue 2434123003: Merge more Kernel infrastructure from kernel_sdk SDK fork. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 import 'expect.dart';
Kevin Millikin (Google) 2016/10/21 09:10:58 Copyright header.
Vyacheslav Egorov (Google) 2016/10/21 13:39:43 Done.
2
3 testNormalRethrow() {
4 var x = 0;
5 try {
6 try {
7 throw x++;
8 } catch (e) {
9 Expect.isTrue(e == 0);
10 x++;
11 rethrow;
12 }
13 } catch (e) {
14 Expect.isTrue(e == 0);
15 x++;
16 }
17 Expect.isTrue(x == 3);
18 }
19
20 testNormalRethrow2() {
21 var x = 0;
22 try {
23 try {
24 throw x++;
25 } on int catch (e) {
26 Expect.isTrue(e == 0);
27 x++;
28 rethrow;
29 }
30 } catch (e) {
31 Expect.isTrue(e == 0);
32 x++;
33 }
34 Expect.isTrue(x == 3);
35 }
36
37 testRethrowWithinTryRethrow() {
38 var x = 0;
39 try {
40 try {
41 throw x++;
42 } on int catch (e) {
43 Expect.isTrue(e == 0);
44 x++;
45 try {
46 x++;
47 rethrow;
48 } finally {
49 x++;
50 }
51 }
52 } catch (e) {
53 Expect.isTrue(e == 0);
54 x++;
55 }
56 Expect.isTrue(x == 5);
57 }
58
59 main() {
60 testNormalRethrow();
61 testNormalRethrow2();
62 testRethrowWithinTryRethrow();
63 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698