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

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

Issue 25350003: Flow control structure formatting (a la the Style Guide). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 28056)
+++ pkg/analyzer_experimental/test/services/formatter_test.dart (working copy)
@@ -763,6 +763,21 @@
'}'
);
});
+
+ test('Statement (if)', () {
+ expectStmtFormatsTo('if (true) print("true!");',
+ 'if (true) print("true!");');
+ expectStmtFormatsTo('if (true) { print("true!"); }',
+ 'if (true) {\n'
+ ' print("true!");\n'
+ '}');
+ expectStmtFormatsTo('if (true) print("true!"); else print("false!");',
+ 'if (true) {\n'
+ ' print("true!");\n'
+ '} else {\n'
+ ' print("false!");\n'
+ '}');
+ });
test('initialIndent', () {
var formatter = new CodeFormatter(
« 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