Chromium Code Reviews| Index: pkg/analyzer/test/services/formatter_test.dart |
| =================================================================== |
| --- pkg/analyzer/test/services/formatter_test.dart (revision 30859) |
| +++ pkg/analyzer/test/services/formatter_test.dart (working copy) |
| @@ -536,6 +536,40 @@ |
| ); |
| }); |
| + test('CU - comments (8)', () { |
| + expectCUFormatsTo( |
| + 'var x /* X */, y;\n', |
| + 'var x /* X */, y;\n' |
| + ); |
| + }); |
| + |
| + test('CU - comments (9)', () { |
| + expectCUFormatsTo( |
| + 'main() {\n' |
| + ' foo(1 /* bang */, 2);\n' |
| + '}\n' |
| + 'foo(x, y) => null;\n', |
| + 'main() {\n' |
| + ' foo(1 /* bang */, 2);\n' |
| + '}\n' |
| + 'foo(x, y) => null;\n' |
| + ); |
| + }); |
| + |
| + test('CU - comments (10)', () { |
|
Brian Wilkerson
2013/12/04 19:52:50
If there isn't already, it might be good to add a
pquitslund
2013/12/04 21:09:10
Good call. I've got one of those in my list tests
|
| + expectCUFormatsTo( |
| + 'var l = [1 /* bang */, 2];\n', |
| + 'var l = [1 /* bang */, 2];\n' |
| + ); |
| + }); |
| + |
| + test('CU - comments (11)', () { |
| + expectCUFormatsTo( |
| + 'var m = {1: 2 /* bang */, 3: 4};\n', |
| + 'var m = {1: 2 /* bang */, 3: 4};\n' |
| + ); |
| + }); |
| + |
| test('CU - EOF nl', () { |
| expectCUFormatsTo( |
| 'var x = 1;', |
| @@ -711,6 +745,20 @@ |
| ); |
| }); |
| + test('stmt (empty while body)', () { |
| + expectStmtFormatsTo( |
| + 'while (true);', |
| + 'while (true);' |
| + ); |
| + }); |
| + |
| + test('stmt (empty for body)', () { |
| + expectStmtFormatsTo( |
| + 'for ( ; ; );', |
| + 'for ( ; ; );' |
| + ); |
| + }); |
| + |
| test('stmt (cascades)', () { |
| expectStmtFormatsTo( |
| '"foo"\n' |