Unverified Commit 1c3f6a85 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Fix formatting of Flex error message (#16498)

parent 0260642f
......@@ -681,7 +681,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
if (node != null) {
information.writeln('The nearest ancestor providing an unbounded width constraint is:');
information.write(' ');
information.write(node.toStringShallow(joiner: '\n '));
information.writeln(node.toStringShallow(joiner: '\n '));
}
information.writeln('See also: https://flutter.io/layout/');
addendum = information.toString();
......
......@@ -110,4 +110,34 @@ void main() {
),
);
});
testWidgets('Error information is printed correctly', (WidgetTester tester) async {
// We run this twice, the first time without an error, so that the second time
// we only get a single exception. Otherwise we'd get two, the one we want and
// an extra one when we discover we never computed a size.
await tester.pumpWidget(
new Column(
children: <Widget>[
new Column(),
],
),
Duration.zero,
EnginePhase.layout,
);
await tester.pumpWidget(
new Column(
children: <Widget>[
new Column(
children: <Widget>[
new Expanded(child: new Container()),
],
),
],
),
Duration.zero,
EnginePhase.layout,
);
final String message = tester.takeException().toString();
expect(message, contains('\nSee also:'));
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment