Index: test/whitespace/functions.unit |
diff --git a/test/whitespace/functions.unit b/test/whitespace/functions.unit |
index 2e8f4871f2f19f213f0275b22b19dad34bd30e77..206ec2b47fac88a21642fea5a426035e9343b64f 100644 |
--- a/test/whitespace/functions.unit |
+++ b/test/whitespace/functions.unit |
@@ -77,10 +77,88 @@ main() sync* { |
var lambda = () sync* {}; |
} |
>>> trailing comma in single parameter list |
-function(argument , ) {} |
+function(parameter , ) {;} |
<<< |
-function(argument,) {} |
+function( |
+ parameter, |
+) { |
+ ; |
+} |
>>> trailing comma in parameter list |
-function(argument,argument , ) {} |
+function(parameter,parameter , ) {;} |
+<<< |
+function( |
+ parameter, |
+ parameter, |
+) { |
+ ; |
+} |
+>>> trailing comma in all optional parameter list |
+function([parameter,parameter , ]) {;} |
+<<< |
+function([ |
+ parameter, |
+ parameter, |
+]) { |
+ ; |
+} |
+>>> trailing comma in all named parameter list |
+function({parameter,parameter , }) {;} |
+<<< |
+function({ |
+ parameter, |
+ parameter, |
+}) { |
+ ; |
+} |
+>>> trailing comma in mixed optional parameter list |
+function(parameter,[parameter,parameter , ]) {;} |
<<< |
-function(argument, argument,) {} |
+function( |
+ parameter, [ |
+ parameter, |
+ parameter, |
+]) { |
+ ; |
+} |
+>>> trailing comma in mixed named parameter list |
+function(parameter,{parameter,parameter , }) {;} |
+<<< |
+function( |
+ parameter, { |
+ parameter, |
+ parameter, |
+}) { |
+ ; |
+} |
+>>> trailing comma with => function containing split |
+function(parameter,parameter,) => veryLongBodyThatWraps(argument, argument, argument, argument); |
+<<< |
+function( |
+ parameter, |
+ parameter, |
+) => |
+ veryLongBodyThatWraps(argument, |
+ argument, argument, argument); |
+>>> trailing comma with wrap at => |
+function(parameter,parameter,) /* comment */ => "a very very long string"; |
+<<< |
+function( |
+ parameter, |
+ parameter, |
+) /* comment */ => |
+ "a very very long string"; |
+>>> trailing comma function nested in expression |
+main() { |
+ someVeryLongFunction(argument, argument, (parameter, parameter,) {;}); |
+} |
+<<< (this looks weird, but it should rare and at least we test it) |
+main() { |
+ someVeryLongFunction( |
+ argument, argument, ( |
+ parameter, |
+ parameter, |
+ ) { |
+ ; |
+ }); |
+} |