Skip to content

Commit 9776539

Browse files
authored
Add a couple of regression tests. (#1512)
These are things I noticed when formatting a corpus using the old prototype version of the new style. Finally got around to adding tests for them. Fortunately, they format as I expect with the new formatter. Having `_api` hanging on the end of the first line doesn't look *great* in this example, but I think it's mostly because it's unusual that the function has such a long signature followed by a very small target expression. In general, it seems to look good to hang the target of a call chain at the end of the same line as a `=>` member body.
1 parent 31422e8 commit 9776539

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/tall/regression/other/misc.unit

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ SomeVeryLongReturnType someFunctionName(
2020
.then(________traverseDeps_depender__deps_);
2121
}
2222
}
23+
>>> Function expression body in expression body member.
24+
ItemRenderer<Project> get projectRenderer => (HasUIDisplayName item) =>
25+
item.uiDisplayName;
26+
<<<
27+
ItemRenderer<Project> get projectRenderer =>
28+
(HasUIDisplayName item) => item.uiDisplayName;
29+
>>> Call chain body after long member header.
30+
Future<String> executeShellCommand(String command) async =>
31+
_api.executeShellCommand(command);
32+
<<<
33+
Future<String> executeShellCommand(String command) async => _api
34+
.executeShellCommand(command);
2335
>>> Split in long type parameter clause.
2436
abstract class StreamNotifierProviderBase<
2537
NotifierT extends AsyncNotifierBase<T>,
@@ -36,4 +48,4 @@ abstract class StreamNotifierProviderBase<
3648
extends ProviderWithNotifier<AsyncValue<T>, NotifierT>
3749
with FutureModifier<T> {
3850
// ...
39-
}
51+
}

0 commit comments

Comments
 (0)