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

Side by Side Diff: tests/language/src/ExecuteFinally4Test.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 i = 1;
16 } finally {
17 i = i + 10;
18 }
19 return i + 200; // Should return here with i = 211.
20 try {
21 int j;
22 j = func();
23 } finally {
24 i = i + 10; // Should not get executed as part of return above.
25 }
26 }
27
28 static int func() {
29 int i = 0;
30 while (i < 10) {
31 i++;
32 }
33 return i;
34 }
35
36 int i;
37 }
38
39 class ExecuteFinally4Test {
40 static testMain() {
41 Helper obj = new Helper();
42 Expect.equals(211, obj.f1());
43 Expect.equals(11, obj.i);
44 }
45 }
46
47 main() {
48 ExecuteFinally4Test.testMain();
49 }
OLDNEW
« no previous file with comments | « tests/language/src/ExecuteFinally3Test.dart ('k') | tests/language/src/ExecuteFinally5Test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698