OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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'; | 5 import 'package:expect/expect.dart'; |
6 | 6 |
7 testSimpleBreak() { | 7 testSimpleBreak() { |
8 var x = 1; | 8 var x = 1; |
9 while (true) { | 9 while (true) { |
10 try { | 10 try { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 161 } |
162 } finally { | 162 } finally { |
163 events = '$events|middle'; | 163 events = '$events|middle'; |
164 } | 164 } |
165 } catch (e) { | 165 } catch (e) { |
166 events = '$events|outer-catch'; | 166 events = '$events|outer-catch'; |
167 } finally { | 167 } finally { |
168 events = '$events|outer-finally'; | 168 events = '$events|outer-finally'; |
169 } | 169 } |
170 Expect.equals( | 170 Expect.equals( |
171 events, | 171 events, '|start|start-catch|inner|middle|outer-catch|outer-finally'); |
172 '|start|start-catch|inner|middle|outer-catch|outer-finally'); | |
173 } | 172 } |
174 | 173 |
175 main() { | 174 main() { |
176 Expect.isTrue(testSimpleBreak() == 3); | 175 Expect.isTrue(testSimpleBreak() == 3); |
177 Expect.isTrue(testReturnFinally() == 42); | 176 Expect.isTrue(testReturnFinally() == 42); |
178 Expect.isTrue(testNestedReturnFinally() == 42); | 177 Expect.isTrue(testNestedReturnFinally() == 42); |
179 Expect.isTrue(testReturnInsideLoop() == 42); | 178 Expect.isTrue(testReturnInsideLoop() == 42); |
180 Expect.isTrue(testStopContinueInsideLoop() == 42); | 179 Expect.isTrue(testStopContinueInsideLoop() == 42); |
181 Expect.isTrue(testStopBreakInsideLoop() == 42); | 180 Expect.isTrue(testStopBreakInsideLoop() == 42); |
182 Expect.isTrue(testStopBreakInsideLoop2() == 42); | 181 Expect.isTrue(testStopBreakInsideLoop2() == 42); |
183 Expect.isTrue(testStopContinueInsideLoop() == 42); | 182 Expect.isTrue(testStopContinueInsideLoop() == 42); |
184 Expect.isTrue(testStopContinueInsideSwitch() == 42); | 183 Expect.isTrue(testStopContinueInsideSwitch() == 42); |
185 Expect.isTrue(testStopContinueInsideSwitch2() == 42); | 184 Expect.isTrue(testStopContinueInsideSwitch2() == 42); |
186 testNestedFinally(); | 185 testNestedFinally(); |
187 } | 186 } |
OLD | NEW |