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

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

Issue 137533005: Whitespace testing fixes and bit-flip to turn on simple line breaking. (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/test/services/data/stmt_tests.data ('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 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 test('printLine - 3', () { 1290 test('printLine - 3', () {
1291 var line = printLine(LINE_1, 8); 1291 var line = printLine(LINE_1, 8);
1292 expect(line, 'foo bar\nbaz foo\nbar baz'); 1292 expect(line, 'foo bar\nbaz foo\nbar baz');
1293 }); 1293 });
1294 1294
1295 test('printLine - 4', () { 1295 test('printLine - 4', () {
1296 var line = printLine(LINE_1, 12); 1296 var line = printLine(LINE_1, 12);
1297 expect(line, 'foo bar baz\nfoo bar baz'); 1297 expect(line, 'foo bar baz\nfoo bar baz');
1298 }); 1298 });
1299 1299
1300 test('isWhitespace', () {
1301 expect(isWhitespace('foo'), false);
1302 expect(isWhitespace(' foo'), false);
1303 expect(isWhitespace('foo '), false);
1304 expect(isWhitespace(' foo '), false);
1305 expect(isWhitespace(' '), true);
1306 expect(isWhitespace(' '), true);
1307 expect(isWhitespace('\t'), true);
1308 expect(isWhitespace('\t\t'), true);
1309 expect(isWhitespace('\n'), true);
1310 expect(isWhitespace('\r'), true);
1311 });
1312
1300 }); 1313 });
1301 1314
1302 /// Helper method tests 1315 /// Helper method tests
1303 group('helpers', () { 1316 group('helpers', () {
1304 1317
1305 test('indentString', () { 1318 test('indentString', () {
1306 expect(getIndentString(0), ''); 1319 expect(getIndentString(0), '');
1307 expect(getIndentString(1), ' '); 1320 expect(getIndentString(1), ' ');
1308 expect(getIndentString(4), ' '); 1321 expect(getIndentString(4), ' ');
1309 }); 1322 });
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 input += lines[i++] + '\n'; 1425 input += lines[i++] + '\n';
1413 } 1426 }
1414 while(++i < lines.length && !lines[i].startsWith('>>>')) { 1427 while(++i < lines.length && !lines[i].startsWith('>>>')) {
1415 expectedOutput += lines[i] + '\n'; 1428 expectedOutput += lines[i] + '\n';
1416 } 1429 }
1417 test('test - (${testIndex++})', () { 1430 test('test - (${testIndex++})', () {
1418 expectClause(input, expectedOutput); 1431 expectClause(input, expectedOutput);
1419 }); 1432 });
1420 } 1433 }
1421 } 1434 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/services/data/stmt_tests.data ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698