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

Side by Side Diff: frog/tests/leg_only/switch_test.dart

Issue 10250002: test rename overhaul: step 5 - frog and leg 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
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 switcher(val) { 5 switcher(val) {
6 var x = 0; 6 var x = 0;
7 switch (val) { 7 switch (val) {
8 case 1: 8 case 1:
9 x = 100; 9 x = 100;
10 break; 10 break;
11 case 2: 11 case 2:
12 x = 200; 12 x = 200;
13 break; 13 break;
14 case 3: 14 case 3:
15 x = 300; 15 x = 300;
16 break; 16 break;
17 default: 17 default:
18 return 400; 18 return 400;
19 break; // Intentional dead code (regression test for crash). 19 break; // Intentional dead code (regression test for crash).
20 } 20 }
21 return x; 21 return x;
22 } 22 }
23 23
24 main() { 24 main() {
25 Expect.equals(100, switcher(1)); 25 Expect.equals(100, switcher(1));
26 Expect.equals(200, switcher(2)); 26 Expect.equals(200, switcher(2));
27 Expect.equals(300, switcher(3)); 27 Expect.equals(300, switcher(3));
28 Expect.equals(400, switcher(4)); 28 Expect.equals(400, switcher(4));
29 } 29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698