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

Unified Diff: packages/dart_style/test/splitting/maps.stmt

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 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
Index: packages/dart_style/test/splitting/maps.stmt
diff --git a/packages/dart_style/test/splitting/maps.stmt b/packages/dart_style/test/splitting/maps.stmt
new file mode 100644
index 0000000000000000000000000000000000000000..791eaa7d7718a03bd485fe226fd61eccc02e141d
--- /dev/null
+++ b/packages/dart_style/test/splitting/maps.stmt
@@ -0,0 +1,160 @@
+40 columns |
+>>> empty map
+var m = { };
+<<<
+var m = {};
+>>> exactly 40 characters
+var m = {first: second, third: forth__};
+<<<
+var m = {first: second, third: forth__};
+>>>
+var m = {first: second, third: fourth, fifth: sixth};
+<<<
+var m = {
+ first: second,
+ third: fourth,
+ fifth: sixth
+};
+>>> splits outer maps even if they fit
+var m = {a: {b: c}, d: {},
+ e: {f: {g: h} } };
+<<<
+var m = {
+ a: {b: c},
+ d: {},
+ e: {
+ f: {g: h}
+ }
+};
+>>> split indirect outer
+var m = {a: function({b: inner})};
+<<<
+var m = {
+ a: function({b: inner})
+};
+>>> empty literal does not force outer split
+var m = {a:{}, b: [], c: () {}};
+<<<
+var m = {a: {}, b: [], c: () {}};
+>>> nested split map
+var m = {first: 1, second: {third: fourth}, fifth: 5, nested: {sixth: seventh, eighth: nine,
+ tenth: eleventh}};
+<<<
+var m = {
+ first: 1,
+ second: {third: fourth},
+ fifth: 5,
+ nested: {
+ sixth: seventh,
+ eighth: nine,
+ tenth: eleventh
+ }
+};
+>>> force multi-line because of contained block
+var m = {first: 1, fn: () {"fn";},third:fourth};
+<<<
+var m = {
+ first: 1,
+ fn: () {
+ "fn";
+ },
+ third: fourth
+};
+>>> containing comments
+var m = {first: one /* bang */, second: two};
+<<<
+var m = {
+ first: one /* bang */,
+ second: two
+};
+>>> const
+var map = const {"foo": "bar", "fuz": null};
+<<<
+var map = const {
+ "foo": "bar",
+ "fuz": null
+};
+>>> dangling comma
+var map = {"foo": "bar" , };
+<<<
+var map = {"foo": "bar",};
+>>> dangling comma multiline
+var map = {"foo": "bar", "fuzzy": null , };
+<<<
+var map = {
+ "foo": "bar",
+ "fuzzy": null,
+};
+>>> preserve newlines in maps containing a line comment
+var map = {
+ // yeah
+ a:b,c:d,
+ e:f,g:h
+};
+<<<
+var map = {
+ // yeah
+ a: b, c: d,
+ e: f, g: h
+};
+>>> wrap between elements even when newlines are preserved
+var map = {
+ // yes
+ first: "value", second: "value", third: "value",
+
+ fourth: "value", fifth: "value", sixth: "value", seventh: "value"
+};
+<<<
+var map = {
+ // yes
+ first: "value", second: "value",
+ third: "value",
+
+ fourth: "value", fifth: "value",
+ sixth: "value", seventh: "value"
+};
+>>> ignore line comment after the "]"
+var map = {
+ a:b,c:
+ d
+} // comment
+;
+<<<
+var map = {a: b, c: d} // comment
+ ;
+>>> preserves one blank line between elements
+var map = {
+
+
+ element: value,
+
+
+
+ // comment
+ element: value,
+
+
+
+ element: value
+
+
+};
+<<<
+var map = {
+ element: value,
+
+ // comment
+ element: value,
+
+ element: value
+};
+>>> ignore newlines between keys and values
+var map = {// comment
+a:
+value
+};
+<<<
+var map = {
+ // comment
+ a: value
+};
« no previous file with comments | « packages/dart_style/test/splitting/map_arguments.stmt ('k') | packages/dart_style/test/splitting/members.unit » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698