Chromium Code Reviews| Index: tests/compiler/dart2js/kernel/control_flow_test.dart |
| diff --git a/tests/compiler/dart2js/kernel/control_flow_test.dart b/tests/compiler/dart2js/kernel/control_flow_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c6ffe844a49ce4a95e9cf14921c4a4b9c9726f64 |
| --- /dev/null |
| +++ b/tests/compiler/dart2js/kernel/control_flow_test.dart |
| @@ -0,0 +1,41 @@ |
| +// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +import 'package:test/test.dart'; |
| + |
| +import 'helper.dart' show check; |
| + |
| +main() { |
| + group('compile control flow', () { |
| + test('simple if statement', () { |
| + String code = ''' |
| + main() { |
| + if (true) { |
|
Siggi Cherem (dart-lang)
2016/09/01 23:51:22
does this generate the condition (or are we elimin
Harry Terkelsen
2016/09/02 17:52:28
we can't compile logical operators yet, but I will
|
| + return 1; |
| + } else { |
| + return 2; |
| + } |
| + }'''; |
| + return check(code); |
| + }); |
| + test('simple if statement no else', () { |
| + String code = ''' |
| + main() { |
| + if (true) { |
| + return 1; |
| + } |
| + }'''; |
| + return check(code); |
| + }); |
| + test('simple dead if statement', () { |
| + String code = ''' |
| + main() { |
| + if (false) { |
| + return 1; |
| + } |
| + }'''; |
| + return check(code); |
| + }); |
| + }); |
| +} |