OLD | NEW |
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 import "package:expect/expect.dart"; |
| 6 |
5 switcher(val) { | 7 switcher(val) { |
6 var x = 0; | 8 var x = 0; |
7 switch (val) { | 9 switch (val) { |
8 case 1: | 10 case 1: |
9 x = 100; | 11 x = 100; |
10 break; | 12 break; |
11 case 2: | 13 case 2: |
12 x = 200; | 14 x = 200; |
13 break; | 15 break; |
14 case 3: | 16 case 3: |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 Expect.equals(400, switcher(4)); | 76 Expect.equals(400, switcher(4)); |
75 | 77 |
76 Expect.equals(100, switcher2(1)); | 78 Expect.equals(100, switcher2(1)); |
77 Expect.equals(100, switcher2(2)); | 79 Expect.equals(100, switcher2(2)); |
78 Expect.equals(200, switcher2(3)); | 80 Expect.equals(200, switcher2(3)); |
79 Expect.equals(200, switcher2(4)); | 81 Expect.equals(200, switcher2(4)); |
80 Expect.equals(200, switcher2(5)); | 82 Expect.equals(200, switcher2(5)); |
81 | 83 |
82 badswitches(42); | 84 badswitches(42); |
83 } | 85 } |
OLD | NEW |