OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 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 | 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 // The break is in the right scope, http://b/3428700 was agreed upon. | 4 // The break is in the right scope, http://b/3428700 was agreed upon. |
5 | 5 |
6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
7 | 7 |
8 class Switch6Test { | 8 class Switch6Test { |
9 | |
10 static testMain() { | 9 static testMain() { |
11 var a = 0; | 10 var a = 0; |
12 var x = -1; | 11 var x = -1; |
13 switch (a) { | 12 switch (a) { |
14 case 0: { | 13 case 0: |
15 x = 0; | 14 { |
16 break; | 15 x = 0; |
17 } | 16 break; |
| 17 } |
18 case 1: | 18 case 1: |
19 x = 1; | 19 x = 1; |
20 break; | 20 break; |
21 } | 21 } |
22 Expect.equals(0, x); | 22 Expect.equals(0, x); |
23 } | 23 } |
24 | |
25 } | 24 } |
26 | 25 |
27 main() { | 26 main() { |
28 Switch6Test.testMain(); | 27 Switch6Test.testMain(); |
29 } | 28 } |
OLD | NEW |