OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import 'package:test/test.dart'; |
| 6 |
| 7 import 'helper.dart' show check; |
| 8 |
| 9 main() { |
| 10 group('compile control flow', () { |
| 11 test('simple if statement', () { |
| 12 String code = ''' |
| 13 main() { |
| 14 if (true) { |
| 15 return 1; |
| 16 } else { |
| 17 return 2; |
| 18 } |
| 19 }'''; |
| 20 return check(code); |
| 21 }); |
| 22 test('simple if statement no else', () { |
| 23 String code = ''' |
| 24 main() { |
| 25 if (true) { |
| 26 return 1; |
| 27 } |
| 28 }'''; |
| 29 return check(code); |
| 30 }); |
| 31 test('simple dead if statement', () { |
| 32 String code = ''' |
| 33 main() { |
| 34 if (false) { |
| 35 return 1; |
| 36 } |
| 37 }'''; |
| 38 return check(code); |
| 39 }); |
| 40 }); |
| 41 } |
OLD | NEW |