OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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:async_helper/async_helper.dart"; | 5 import "package:async_helper/async_helper.dart"; |
6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
7 | 7 |
8 var a = 0; | 8 var a = 0; |
9 | 9 |
10 testSync () { | 10 testSync() { |
11 do { | 11 do { |
12 continue; | 12 continue; |
13 } while (throw "Error"); | 13 } while (throw "Error"); |
14 a = 100; | 14 a = 100; |
15 } | 15 } |
16 | 16 |
17 testAsync() async { | 17 testAsync() async { |
18 do { | 18 do { |
19 continue; | 19 continue; |
20 } while (await (throw "Error")); | 20 } while (await (throw "Error")); |
(...skipping 12 matching lines...) Expand all Loading... |
33 await testAsync(); | 33 await testAsync(); |
34 } catch (e) { | 34 } catch (e) { |
35 Expect.equals(e, "Error"); | 35 Expect.equals(e, "Error"); |
36 } | 36 } |
37 Expect.equals(a, 0); | 37 Expect.equals(a, 0); |
38 } | 38 } |
39 | 39 |
40 main() { | 40 main() { |
41 asyncStart(); | 41 asyncStart(); |
42 test().then((_) => asyncEnd()); | 42 test().then((_) => asyncEnd()); |
43 } | 43 } |
OLD | NEW |