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

Unified Diff: packages/dart_style/test/splitting/function_arguments.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/function_arguments.stmt
diff --git a/packages/dart_style/test/splitting/function_arguments.stmt b/packages/dart_style/test/splitting/function_arguments.stmt
new file mode 100644
index 0000000000000000000000000000000000000000..89c09563b54703a651804d73f69d70fd29db60a6
--- /dev/null
+++ b/packages/dart_style/test/splitting/function_arguments.stmt
@@ -0,0 +1,181 @@
+40 columns |
+>>> args before and after function do not force nesting
+method(first,() {fn;},third);
+<<<
+method(first, () {
+ fn;
+}, third);
+>>> nothing but function args does not nest
+longFunctionName(() {;}, () {;}, () {;});
+<<<
+longFunctionName(() {
+ ;
+}, () {
+ ;
+}, () {
+ ;
+});
+>>> trailing functions do not nest
+longFunctionName(argument, argument, argument, argument, () {;}, () {;});
+<<<
+longFunctionName(argument, argument,
+ argument, argument, () {
+ ;
+}, () {
+ ;
+});
+>>> leading functions do not nest
+longFunctionName(() {;}, () {;}, argument, argument, argument, argument);
+<<<
+longFunctionName(() {
+ ;
+}, () {
+ ;
+}, argument, argument, argument,
+ argument);
+>>> arg between functions forces nesting
+longFunctionName(() {;}, argument, () {;});
+<<<
+longFunctionName(
+ () {
+ ;
+ },
+ argument,
+ () {
+ ;
+ });
+>>> unsplit leading args
+longFunctionName(arg, arg, () {;}, () {;});
+<<<
+longFunctionName(arg, arg, () {
+ ;
+}, () {
+ ;
+});
+>>> split before leading args
+longFunctionName(argument, argument, argument, () {;}, () {;});
+<<<
+longFunctionName(
+ argument, argument, argument, () {
+ ;
+}, () {
+ ;
+});
+>>> split in middle of leading args
+longFunctionName(argument, argument, argument, argument, () {;}, () {;});
+<<<
+longFunctionName(argument, argument,
+ argument, argument, () {
+ ;
+}, () {
+ ;
+});
+>>> split before all leading args
+longFunctionName(argument, argument, argument, argument, argument, argument,
+() {;}, () {;});
+<<<
+longFunctionName(
+ argument,
+ argument,
+ argument,
+ argument,
+ argument,
+ argument, () {
+ ;
+}, () {
+ ;
+});
+>>> unsplit trailing args
+longFunctionName(() {;}, () {;}, argument, argument);
+<<<
+longFunctionName(() {
+ ;
+}, () {
+ ;
+}, argument, argument);
+>>> split before trailing args
+longFunctionName(() {;}, () {;} /* very very long comment */, argument, argument);
+<<<
+longFunctionName(() {
+ ;
+}, () {
+ ;
+} /* very very long comment */,
+ argument, argument);
+>>> split in middle of trailing args
+longFunctionName(() {;}, () {;}, argument, argument, argument, argument);
+<<<
+longFunctionName(() {
+ ;
+}, () {
+ ;
+}, argument, argument, argument,
+ argument);
+>>> split before all trailing args
+longFunctionName(() {;}, () {;}, argument, argument, argument, argument,
+argument, argument, argument);
+<<<
+longFunctionName(() {
+ ;
+}, () {
+ ;
+},
+ argument,
+ argument,
+ argument,
+ argument,
+ argument,
+ argument,
+ argument);
+>>> functions with named arguments
+longFunctionName(() {;}, a: () {;}, b: () {;});
+<<<
+longFunctionName(() {
+ ;
+}, a: () {
+ ;
+}, b: () {
+ ;
+});
+>>> do not nest because of nested 1-arg fn
+outer(inner(() {body;}));
+<<<
+outer(inner(() {
+ body;
+}));
+>>> do not nest because of nested many-arg fn
+outer(argument, inner(() {body;}));
+<<<
+outer(argument, inner(() {
+ body;
+}));
+>>> do not nest because of nested 1-arg method call
+obj.outer(a.b.c.fn(() {body;}));
+<<<
+obj.outer(a.b.c.fn(() {
+ body;
+}));
+>>> do not nest because of nested many-arg method call
+obj.outer(argument, a.b.c.fn(() {body;}));
+<<<
+obj.outer(argument, a.b.c.fn(() {
+ body;
+}));
+>>> do not force named args to split on positional function
+function(argument, () {;},
+ named: argument, another: argument);
+<<<
+function(argument, () {
+ ;
+}, named: argument, another: argument);
+>>> args before and after functions split independently
+longFunction(argument, argument, argument, argument, argument,
+() {;}, () {;}, argument, argument, argument, argument, argument);
+<<<
+longFunction(argument, argument,
+ argument, argument, argument, () {
+ ;
+}, () {
+ ;
+}, argument, argument, argument,
+ argument, argument);
« no previous file with comments | « packages/dart_style/test/splitting/expressions.stmt ('k') | packages/dart_style/test/splitting/imports.unit » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698