fix low count of items scanned
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user