style: dart format reflow (no behavior change)

This commit is contained in:
vjrj 2026-07-09 22:19:43 +02:00
parent cf5d302cc1
commit e3ec855630
17 changed files with 197 additions and 139 deletions

View file

@ -12,21 +12,24 @@ String page(List<String> words) =>
void main() {
group('pickLabelFromHocr picks the largest print, not the longest line', () {
test('Aubergine Black Beauty packet → the variety name, not boilerplate', () {
// "Organic Product" (14 letters) is longer than "Black Beauty" (11) but
// printed smaller the old longest-line heuristic wrongly picked it.
final hocr = page([
word('BonPrime', 120, 300, 300, 335), // brand, tiny
word('Organic', 130, 1050, 320, 1095), // boilerplate, small
word('Product', 130, 1100, 340, 1145),
word('AUBERGINE', 380, 1180, 900, 1300), // the title (tallest)
word('BLACK', 380, 1330, 620, 1410),
word('BEAUTY', 640, 1330, 900, 1410),
word('HERB', 430, 1470, 560, 1510), // boilerplate, small
word('SEEDS', 580, 1470, 740, 1510),
]);
expect(pickLabelFromHocr(hocr), 'Aubergine Black Beauty');
});
test(
'Aubergine Black Beauty packet → the variety name, not boilerplate',
() {
// "Organic Product" (14 letters) is longer than "Black Beauty" (11) but
// printed smaller the old longest-line heuristic wrongly picked it.
final hocr = page([
word('BonPrime', 120, 300, 300, 335), // brand, tiny
word('Organic', 130, 1050, 320, 1095), // boilerplate, small
word('Product', 130, 1100, 340, 1145),
word('AUBERGINE', 380, 1180, 900, 1300), // the title (tallest)
word('BLACK', 380, 1330, 620, 1410),
word('BEAUTY', 640, 1330, 900, 1410),
word('HERB', 430, 1470, 560, 1510), // boilerplate, small
word('SEEDS', 580, 1470, 740, 1510),
]);
expect(pickLabelFromHocr(hocr), 'Aubergine Black Beauty');
},
);
test('Cucumber Supermarketer packet → the variety name', () {
final hocr = page([