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

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

Issue 100553004: Fix for extra space preceding the 'on' keyword in a catch clause (dartbug.com/15454). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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/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/src/generated/java_core.dart' show CharSequence; 7 import 'package:analyzer/src/generated/java_core.dart' show CharSequence;
8 import 'package:analyzer/src/generated/scanner.dart'; 8 import 'package:analyzer/src/generated/scanner.dart';
9 import 'package:analyzer/src/services/formatter_impl.dart'; 9 import 'package:analyzer/src/services/formatter_impl.dart';
10 import 'package:analyzer/src/services/writer.dart'; 10 import 'package:analyzer/src/services/writer.dart';
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 'doSomething();\n' 829 'doSomething();\n'
830 '} catch (e) {\n' 830 '} catch (e) {\n'
831 'print(e);\n' 831 'print(e);\n'
832 '}', 832 '}',
833 'try {\n' 833 'try {\n'
834 ' doSomething();\n' 834 ' doSomething();\n'
835 '} catch (e) {\n' 835 '} catch (e) {\n'
836 ' print(e);\n' 836 ' print(e);\n'
837 '}' 837 '}'
838 ); 838 );
839 expectStmtFormatsTo(
840 'try{\n'
841 'doSomething();\n'
842 '}on Exception catch (e){\n'
843 'print(e);\n'
844 '}',
845 'try {\n'
846 ' doSomething();\n'
847 '} on Exception catch (e) {\n'
848 ' print(e);\n'
849 '}'
850 );
839 }); 851 });
840 852
841 test('stmt (binary/ternary ops)', () { 853 test('stmt (binary/ternary ops)', () {
842 expectStmtFormatsTo( 854 expectStmtFormatsTo(
843 'var a = 1 + 2 / (3 * -b);', 855 'var a = 1 + 2 / (3 * -b);',
844 'var a = 1 + 2 / (3 * -b);' 856 'var a = 1 + 2 / (3 * -b);'
845 ); 857 );
846 expectStmtFormatsTo( 858 expectStmtFormatsTo(
847 'var c = !condition == a > b;', 859 'var c = !condition == a > b;',
848 'var c = !condition == a > b;' 860 'var c = !condition == a > b;'
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 expect(() => new TokenStreamComparator(null, t1, t2).verifyEquals(), 1148 expect(() => new TokenStreamComparator(null, t1, t2).verifyEquals(),
1137 throwsA(new isInstanceOf<FormatterException>())); 1149 throwsA(new isInstanceOf<FormatterException>()));
1138 1150
1139 expectCUFormatsTo(src, expected, {transforms: true}) => 1151 expectCUFormatsTo(src, expected, {transforms: true}) =>
1140 expect(formatCU(src, options: new FormatterOptions( 1152 expect(formatCU(src, options: new FormatterOptions(
1141 codeTransforms: transforms)).source, equals(expected)); 1153 codeTransforms: transforms)).source, equals(expected));
1142 1154
1143 expectStmtFormatsTo(src, expected, {transforms: true}) => 1155 expectStmtFormatsTo(src, expected, {transforms: true}) =>
1144 expect(formatStatement(src, options: 1156 expect(formatStatement(src, options:
1145 new FormatterOptions(codeTransforms: transforms)), equals(expected)); 1157 new FormatterOptions(codeTransforms: transforms)), equals(expected));
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/services/formatter_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698