Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: pkg/analyzer/test/services/formatter_test.dart

Issue 319063004: Formatter: don't indent EOL comment at the beginning of a line. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/services/writer.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library formatter_test; 5 library formatter_test;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:path/path.dart'; 9 import 'package:path/path.dart';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 '}\n', 177 '}\n',
178 'library foo;\n' 178 'library foo;\n'
179 '\n' 179 '\n'
180 '//comment one\n' 180 '//comment one\n'
181 '\n' 181 '\n'
182 '//comment two\n' 182 '//comment two\n'
183 '\n' 183 '\n'
184 'class C {\n' 184 'class C {\n'
185 '}\n' 185 '}\n'
186 ); 186 );
187 expectCUFormatsTo(
188 'main() {\n'
189 '// print(1);\n'
190 '// print(2);\n'
191 ' print(3);\n'
192 '}\n',
193 'main() {\n'
194 '// print(1);\n'
195 '// print(2);\n'
196 ' print(3);\n'
197 '}\n'
198 );
199 expectCUFormatsTo(
200 'class A {\n'
201 '// int a;\n'
202 '// int b;\n'
203 ' int c;\n'
204 '}\n',
205 'class A {\n'
206 '// int a;\n'
207 '// int b;\n'
208 ' int c;\n'
209 '}\n'
210 );
187 }); 211 });
188 212
189 test('CU - nested functions', () { 213 test('CU - nested functions', () {
190 expectCUFormatsTo( 214 expectCUFormatsTo(
191 'x() {\n' 215 'x() {\n'
192 ' y() {\n' 216 ' y() {\n'
193 ' }\n' 217 ' }\n'
194 '}\n', 218 '}\n',
195 'x() {\n' 219 'x() {\n'
196 ' y() {\n' 220 ' y() {\n'
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1484 input += lines[i++] + '\n'; 1508 input += lines[i++] + '\n';
1485 } 1509 }
1486 while(++i < lines.length && !lines[i].startsWith('>>>')) { 1510 while(++i < lines.length && !lines[i].startsWith('>>>')) {
1487 expectedOutput += lines[i] + '\n'; 1511 expectedOutput += lines[i] + '\n';
1488 } 1512 }
1489 test('test - (${testIndex++})', () { 1513 test('test - (${testIndex++})', () {
1490 expectClause(input, expectedOutput); 1514 expectClause(input, expectedOutput);
1491 }); 1515 });
1492 } 1516 }
1493 } 1517 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/services/writer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698