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

Side by Side Diff: tests/language/src/ExecuteFinally2Test.dart

Issue 10248007: test rename overhaul: step 8 - language tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011, 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 // Dart test program for testing execution of finally blocks on
5 // control flow breaks because of 'return', 'continue' etc.
6
7
8 class Helper {
9 Helper() : i = 0 { }
10
11 int f1() {
12 try {
13 int j;
14 j = func();
15 try {
16 i = 1;
17 return i; // Value of i is 1 on return.
18 } finally {
19 i = i + 400; // Should get executed when we return.
20 }
21 i = 2; // Should not get executed.
22 return i;
23 } finally {
24 i = i + 800; // Should get executed when we return.
25 }
26 return i + 200; // Should not get executed.
27 }
28
29 static int func() {
30 int i = 0;
31 while (i < 10) {
32 i++;
33 }
34 return i;
35 }
36
37 int i;
38 }
39
40 class ExecuteFinally2Test {
41 static testMain() {
42 Helper obj = new Helper();
43 Expect.equals(1, obj.f1());
44 Expect.equals(1201, obj.i);
45 }
46 }
47
48 main() {
49 ExecuteFinally2Test.testMain();
50 }
OLDNEW
« no previous file with comments | « tests/language/src/ExecuteFinally1Test.dart ('k') | tests/language/src/ExecuteFinally3Test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698