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