use sentence case in error message titles (#35750)

* use sentence case in error message titles

* add a test
This commit is contained in:
Devon Carew 2019-07-22 12:49:53 -07:00 committed by GitHub
parent b79136ba5a
commit 45ae4f6dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -459,7 +459,7 @@ class FlutterErrorDetails extends Diagnosticable {
@override
String toStringShort() {
return library != null ? 'Exception Caught By $library' : 'Exception Caught';
return library != null ? 'Exception caught by $library' : 'Exception caught';
}
@override

View File

@ -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', () {
FlutterError error = FlutterError(
'My Error Summary.\n'