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

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

Issue 136983004: Line-break indenter plumbing. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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 import 'dart:io'; 5 import 'dart:io';
6 6
7 import 'package:path/path.dart'; 7 import 'package:path/path.dart';
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 9
10 import 'package:analyzer/src/generated/java_core.dart' show CharSequence; 10 import 'package:analyzer/src/generated/java_core.dart' show CharSequence;
(...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 expect(line, 'foo bar baz\nfoo bar baz'); 1297 expect(line, 'foo bar baz\nfoo bar baz');
1298 }); 1298 });
1299 1299
1300 }); 1300 });
1301 1301
1302 /// Helper method tests 1302 /// Helper method tests
1303 group('helpers', () { 1303 group('helpers', () {
1304 1304
1305 test('indentString', () { 1305 test('indentString', () {
1306 expect(getIndentString(0), ''); 1306 expect(getIndentString(0), '');
1307 expect(getIndentString(1), ' '); 1307 expect(getIndentString(1), ' ');
1308 expect(getIndentString(4), ' '); 1308 expect(getIndentString(4), ' ');
1309 }); 1309 });
1310 1310
1311 test('indentString (tabbed)', () { 1311 test('indentString (tabbed)', () {
1312 expect(getIndentString(0, useTabs: true), ''); 1312 expect(getIndentString(0, useTabs: true), '');
1313 expect(getIndentString(1, useTabs: true), '\t'); 1313 expect(getIndentString(1, useTabs: true), '\t');
1314 expect(getIndentString(3, useTabs: true), '\t\t\t'); 1314 expect(getIndentString(3, useTabs: true), '\t\t\t');
1315 }); 1315 });
1316 1316
1317 test('repeat', () { 1317 test('repeat', () {
1318 expect(repeat('x', 0), ''); 1318 expect(repeat('x', 0), '');
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 input += lines[i++] + '\n'; 1412 input += lines[i++] + '\n';
1413 } 1413 }
1414 while(++i < lines.length && !lines[i].startsWith('>>>')) { 1414 while(++i < lines.length && !lines[i].startsWith('>>>')) {
1415 expectedOutput += lines[i] + '\n'; 1415 expectedOutput += lines[i] + '\n';
1416 } 1416 }
1417 test('test - (${testIndex++})', () { 1417 test('test - (${testIndex++})', () {
1418 expectClause(input, expectedOutput); 1418 expectClause(input, expectedOutput);
1419 }); 1419 });
1420 } 1420 }
1421 } 1421 }
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