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

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

Issue 26164007: Formatter method cascade indents. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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_experimental/lib/src/services/formatter_impl.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 'package:unittest/unittest.dart'; 5 import 'package:unittest/unittest.dart';
6 6
7 import 'package:analyzer_experimental/src/generated/scanner.dart'; 7 import 'package:analyzer_experimental/src/generated/scanner.dart';
8 import 'package:analyzer_experimental/src/services/formatter_impl.dart'; 8 import 'package:analyzer_experimental/src/services/formatter_impl.dart';
9 import 'package:analyzer_experimental/src/services/writer.dart'; 9 import 'package:analyzer_experimental/src/services/writer.dart';
10 10
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 ' case "apple":\n' 703 ' case "apple":\n'
704 ' print("delish");\n' 704 ' print("delish");\n'
705 ' break;\n' 705 ' break;\n'
706 ' case "fig":\n' 706 ' case "fig":\n'
707 ' print("bleh");\n' 707 ' print("bleh");\n'
708 ' break;\n' 708 ' break;\n'
709 '}' 709 '}'
710 ); 710 );
711 }); 711 });
712 712
713 test('stmt (cascades)', () {
714 expectStmtFormatsTo(
715 '"foo"\n'
716 '..toString()\n'
717 '..toString();',
718 '"foo"\n'
719 ' ..toString()\n'
720 ' ..toString();'
721 );
722 });
723
713 test('stmt (generics)', () { 724 test('stmt (generics)', () {
714 expectStmtFormatsTo( 725 expectStmtFormatsTo(
715 'var numbers = <int>[1, 2, (3 + 4)];', 726 'var numbers = <int>[1, 2, (3 + 4)];',
716 'var numbers = <int>[1, 2, (3 + 4)];' 727 'var numbers = <int>[1, 2, (3 + 4)];'
717 ); 728 );
718 }); 729 });
719 730
720 test('stmt (lists)', () { 731 test('stmt (lists)', () {
721 expectStmtFormatsTo( 732 expectStmtFormatsTo(
722 'var l = [1,2,3,4];', 733 'var l = [1,2,3,4];',
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 expect(() => new TokenStreamComparator(null, t1, t2).verifyEquals(), 1063 expect(() => new TokenStreamComparator(null, t1, t2).verifyEquals(),
1053 throwsA(new isInstanceOf<FormatterException>())); 1064 throwsA(new isInstanceOf<FormatterException>()));
1054 1065
1055 expectCUFormatsTo(src, expected, {transforms: true}) => 1066 expectCUFormatsTo(src, expected, {transforms: true}) =>
1056 expect(formatCU(src, options: new FormatterOptions( 1067 expect(formatCU(src, options: new FormatterOptions(
1057 codeTransforms: transforms)).source, equals(expected)); 1068 codeTransforms: transforms)).source, equals(expected));
1058 1069
1059 expectStmtFormatsTo(src, expected, {transforms: true}) => 1070 expectStmtFormatsTo(src, expected, {transforms: true}) =>
1060 expect(formatStatement(src, options: 1071 expect(formatStatement(src, options:
1061 new FormatterOptions(codeTransforms: transforms)), equals(expected)); 1072 new FormatterOptions(codeTransforms: transforms)), equals(expected));
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/services/formatter_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698