Chromium Code Reviews| Index: pkg/analyzer2dart/test/end2end_test.dart |
| diff --git a/pkg/analyzer2dart/test/end2end_test.dart b/pkg/analyzer2dart/test/end2end_test.dart |
| index 8bdbfffaa2e3b25770a38453e02c4a22054ecc39..64f83a0d4ef566ce1643ca37e3f2ce73345cc0a9 100644 |
| --- a/pkg/analyzer2dart/test/end2end_test.dart |
| +++ b/pkg/analyzer2dart/test/end2end_test.dart |
| @@ -486,7 +486,7 @@ main(a) { |
| '''); |
| }); |
| - test('If statement', () { |
| + test('Conditional expression', () { |
| checkResult(''' |
| main(a) { |
| return a ? print(0) : print(1); |
| @@ -497,6 +497,59 @@ main(a) { |
| } |
| '''); |
| }); |
| + |
|
sigurdm
2014/10/21 08:22:44
Maybe it would be beneficial to add a comment to e
Johnni Winther
2014/10/23 06:55:12
Done.
|
| + test('Block statements', () { |
| + checkResult(''' |
| +main(a) { |
| + return 0; |
| + return 1; |
| +} |
| +''', ''' |
| +main(a) { |
| + return 0; |
| +} |
| +'''); |
| + |
| + checkResult(''' |
| +main(a) { |
| + if (a) { |
| + return 0; |
| + return 1; |
| + } else { |
| + return 2; |
| + return 3; |
| + } |
| +} |
| +''', ''' |
| +main(a) { |
| + return a ? 0 : 2; |
| +} |
| +'''); |
| + |
| + checkResult(''' |
| +main(a) { |
| + if (a) { |
| + print(0); |
| + return 0; |
| + return 1; |
| + } else { |
| + print(2); |
| + return 2; |
| + return 3; |
| + } |
| +} |
| +''', ''' |
| +main(a) { |
| + if (a) { |
| + print(0); |
| + return 0; |
| + } else { |
| + print(2); |
| + return 2; |
| + } |
| +} |
| +'''); |
| + }); |
| } |
| checkResult(String input, [String expectedOutput]) { |