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 int calls = 0; | 5 int calls = 0; |
8 | 6 |
9 void callMeOnce() { | 7 void callMeOnce() { |
10 Expect.equals(0, calls); | 8 Expect.equals(0, calls); |
11 calls++; | 9 calls++; |
12 } | 10 } |
13 | 11 |
14 main() { | 12 main() { |
15 int i = 0; | 13 int i = 0; |
16 do { | 14 do { |
17 i++; | 15 i++; |
18 if (i > 3) break; | 16 if (i > 3) break; |
19 } while (i < 10); | 17 } while (i < 10); |
20 | 18 |
21 callMeOnce(); | 19 callMeOnce(); |
22 Expect.equals(4, i); | 20 Expect.equals(4, i); |
23 } | 21 } |
OLD | NEW |