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

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

Issue 23451037: Optional trailing comma support for list and map literals. (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 27343)
+++ pkg/analyzer_experimental/test/services/formatter_test.dart (working copy)
@@ -671,12 +671,30 @@
'var numbers = <int>[1, 2, (3 + 4)];'
);
});
+
+ test('stmt (lists)', () {
+ expectStmtFormatsTo(
+ 'var l = [1,2,3,4];',
+ 'var l = [1, 2, 3, 4];'
+ );
+ //Dangling ','
+ expectStmtFormatsTo(
+ 'var l = [1,];',
+ 'var l = [1,];'
+ );
+ });
test('stmt (maps)', () {
expectStmtFormatsTo(
'var map = const {"foo": "bar", "fuz": null};',
'var map = const {"foo": "bar", "fuz": null};'
);
+
+ //Dangling ','
+ expectStmtFormatsTo(
+ 'var map = {"foo": "bar",};',
+ 'var map = {"foo": "bar",};'
+ );
});
test('stmt (try/catch)', () {
« 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