fix low count of items scanned

This commit is contained in:
davmar
2026-09-01 17:52:52 +02:00
parent cdf46bb12a
commit d532af6111
2 changed files with 59 additions and 11 deletions
+29
View File
@@ -15,6 +15,35 @@ CHANGE 1.50
expect(items.map((item) => item.price), [1.50, 2.00]);
});
test('parses name on one line and price on the next', () {
final items = ReceiptParser.parse('''
MILK
1,50
BREAD
2,00
Totaal 3,50
''');
expect(items, hasLength(2));
expect(items.map((item) => item.name), ['MILK', 'BREAD']);
expect(items.map((item) => item.price), [1.50, 2.00]);
});
test('pairs two name lines with two price lines from short column OCR', () {
final items = ReceiptParser.parse('''
Jumbo
MILK
BREAD
1,50
2,00
Totaal 3,50
''');
expect(items, hasLength(2));
expect(items.map((item) => item.name), ['MILK', 'BREAD']);
expect(items.map((item) => item.price), [1.50, 2.00]);
});
test('uses the next line when quantity and total are split', () {
final items = ReceiptParser.parse('''
EGGS