use sentence case in error message titles (#35750)
* use sentence case in error message titles * add a test
This commit is contained in:
parent
b79136ba5a
commit
45ae4f6dbe
@ -459,7 +459,7 @@ class FlutterErrorDetails extends Diagnosticable {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String toStringShort() {
|
String toStringShort() {
|
||||||
return library != null ? 'Exception Caught By $library' : 'Exception Caught';
|
return library != null ? 'Exception caught by $library' : 'Exception caught';
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -122,6 +122,20 @@ void main() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('FlutterErrorDetails.toStringShort', () {
|
||||||
|
expect(
|
||||||
|
FlutterErrorDetails(
|
||||||
|
exception: 'MESSAGE',
|
||||||
|
library: 'library',
|
||||||
|
context: ErrorDescription('CONTEXTING'),
|
||||||
|
informationCollector: () sync* {
|
||||||
|
yield ErrorDescription('INFO');
|
||||||
|
},
|
||||||
|
).toStringShort(),
|
||||||
|
'Exception caught by library',
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
test('FlutterError default constructor', () {
|
test('FlutterError default constructor', () {
|
||||||
FlutterError error = FlutterError(
|
FlutterError error = FlutterError(
|
||||||
'My Error Summary.\n'
|
'My Error Summary.\n'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user