| 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:test/test.dart'; | 5 import 'package:test/test.dart'; |
| 6 | 6 |
| 7 import 'helper.dart' show check; | 7 import 'helper.dart' show check; |
| 8 | 8 |
| 9 main() { | 9 main() { |
| 10 test('for loop', () { | 10 test('for loop', () { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 main() { | 76 main() { |
| 77 var sum = 0; | 77 var sum = 0; |
| 78 for (a in [1, 2, 3]) { | 78 for (a in [1, 2, 3]) { |
| 79 sum += a; | 79 sum += a; |
| 80 } | 80 } |
| 81 return sum; | 81 return sum; |
| 82 }'''; | 82 }'''; |
| 83 return check(code, disableTypeInference: false); | 83 return check(code, disableTypeInference: false); |
| 84 }); | 84 }); |
| 85 | 85 |
| 86 test('for loop with break to label', () { | 86 // TODO(efortuna): Fix and uncomment. |
| 87 // See bug https://github.com/dart-lang/sdk/issues/28670 |
| 88 /*test('for loop with break to label', () { |
| 87 String code = ''' | 89 String code = ''' |
| 88 var a = 0; | 90 var a = 0; |
| 89 main() { | 91 main() { |
| 90 var sum = 0; | 92 var sum = 0; |
| 91 outer: for (a in [1, 2, 3]) { | 93 outer: for (a in [1, 2, 3]) { |
| 92 for (int i = 0; i < 10; i++) { | 94 for (int i = 0; i < 10; i++) { |
| 93 sum += a; | 95 sum += a; |
| 94 if (a + i < 5) | 96 if (a + i < 5) |
| 95 break outer; | 97 break outer; |
| 96 } | 98 } |
| 97 } | 99 } |
| 98 return sum; | 100 return sum; |
| 99 }'''; | 101 }'''; |
| 100 return check(code, disableTypeInference: false); | 102 return check(code, disableTypeInference: false); |
| 101 }); | 103 });*/ |
| 102 } | 104 } |
| OLD | NEW |