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

Unified Diff: pkg/analyzer_experimental/test/services/formatter_test.dart

Issue 26229004: Code formatter transform for empty constructor bodys (a la Style guide). (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer_experimental/lib/src/services/formatter_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_experimental/test/services/formatter_test.dart
===================================================================
--- pkg/analyzer_experimental/test/services/formatter_test.dart (revision 28369)
+++ pkg/analyzer_experimental/test/services/formatter_test.dart (working copy)
@@ -638,6 +638,30 @@
);
});
+ test('CU (empty cons bodies)', () {
+ expectCUFormatsTo(
+ 'class A {\n'
+ ' A() {\n'
+ ' }\n'
+ '}\n',
+ 'class A {\n'
+ ' A();\n'
+ '}\n',
+ transforms: true
+ );
+ expectCUFormatsTo(
+ 'class A {\n'
+ ' A() {\n'
+ ' }\n'
+ '}\n',
+ 'class A {\n'
+ ' A() {\n'
+ ' }\n'
+ '}\n',
+ transforms: false
+ );
+ });
+
test('stmt', () {
expectStmtFormatsTo(
'if (true){\n'
@@ -1028,8 +1052,9 @@
expect(() => new TokenStreamComparator(null, t1, t2).verifyEquals(),
throwsA(new isInstanceOf<FormatterException>()));
-expectCUFormatsTo(src, expected) =>
- expect(formatCU(src).source, equals(expected));
+expectCUFormatsTo(src, expected, {transforms: true}) =>
+ expect(formatCU(src, options: new FormatterOptions(
+ codeTransforms: transforms)).source, equals(expected));
expectStmtFormatsTo(src, expected, {transforms: true}) =>
expect(formatStatement(src, options:
« 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