Add the number of mismatched pixels to golden tests output (#142975)

Fixes https://github.com/flutter/flutter/issues/141036
This commit is contained in:
Valentin Vignal 2024-02-08 02:59:57 +08:00 committed by GitHub
parent 0202e3bf7a
commit ab836a2db0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -262,7 +262,7 @@ Future<ComparisonResult> compareLists(List<int>? test, List<int>? master) async
passed: false,
diffPercent: diffPercent,
error: 'Pixel test failed, '
'${(diffPercent * 100).toStringAsFixed(2)}% '
'${(diffPercent * 100).toStringAsFixed(2)}%, ${pixelDiffCount}px '
'diff detected.',
diffs: <String, Image>{
'masterImage' : masterImage,

View file

@ -192,7 +192,7 @@ void main() {
throwsA(isFlutterError.having(
(FlutterError error) => error.message,
'message',
contains('% diff detected'),
contains('100.00%, 1px diff detected'),
)),
);
final io.File master = fs.file(
@ -223,7 +223,7 @@ void main() {
throwsA(isFlutterError.having(
(FlutterError error) => error.message,
'message',
contains('% diff detected'),
contains('100.00%, 1px diff detected'),
)),
);
final io.File master = fs.file(
@ -302,7 +302,7 @@ void main() {
throwsA(isFlutterError.having(
(FlutterError error) => error.message,
'message',
contains('% diff detected'),
contains('100.00%, 1px diff detected'),
)),
);
});