From: Christian Heller Date: Sat, 24 Jan 2026 12:01:12 +0000 (+0100) Subject: Fix _blocks_valid_up_incl not actually being "_incl". X-Git-Url: https://plomlompom.com/repos/booking/%7B%7Bprefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/index.html?a=commitdiff_plain;h=5cfc676e8f8d6b9ae18d5671602fb7d1945c61fa;p=ledgplom Fix _blocks_valid_up_incl not actually being "_incl". --- diff --git a/src/ledgplom/ledger.py b/src/ledgplom/ledger.py index 2706125..9af74cb 100644 --- a/src/ledgplom/ledger.py +++ b/src/ledgplom/ledger.py @@ -654,7 +654,7 @@ class Ledger: def _blocks_valid_up_incl(self, block_id: int) -> bool: 'Whether nothing questionable about blocks until block_id.' - for block in self.blocks[:block_id]: + for block in self.blocks[:block_id + 1]: if block.booking: if block.booking.sink_error: return False diff --git a/src/tests/full.balance b/src/tests/full.balance index 4c70e1e..f68cfd4 100644 --- a/src/tests/full.balance +++ b/src/tests/full.balance @@ -92,7 +92,7 @@ span.indent { - + diff --git a/src/tests/full.balance.4 b/src/tests/full.balance.4 index c48034a..6785650 100644 --- a/src/tests/full.balance.4 +++ b/src/tests/full.balance.4 @@ -83,7 +83,7 @@ span.indent { | balance after booking 4 (2001-01-03: test)

-
-18-19 €
+
@@ -92,7 +92,7 @@ span.indent { - + diff --git a/src/tests/full.dat b/src/tests/full.dat index 2bb5747..080eec2 100644 --- a/src/tests/full.dat +++ b/src/tests/full.dat @@ -7,12 +7,10 @@ 2001-01-02 test bar -10 € ; bar baz 10 € - baz x € 2001-01-02 test bar 20 € - bar 1 € baz -20 € ; baz 2001-01-03 test diff --git a/src/tests/full.edit_raw.4 b/src/tests/full.edit_raw.4 index c49bb94..158fa53 100644 --- a/src/tests/full.edit_raw.4 +++ b/src/tests/full.edit_raw.4 @@ -90,7 +90,7 @@ td.direct_target { -
-9-10 €
+
@@ -104,7 +104,7 @@ td.direct_target {
account
- + @@ -132,7 +132,7 @@ td.direct_target {
10 €
- + diff --git a/src/tests/full.edit_structured.4 b/src/tests/full.edit_structured.4 index 2445a52..46e97f6 100644 --- a/src/tests/full.edit_structured.4 +++ b/src/tests/full.edit_structured.4 @@ -221,7 +221,7 @@ to
-
-9-10 €
+
@@ -235,7 +235,7 @@ to
account
- + @@ -263,7 +263,7 @@ to
10 €
- + diff --git a/src/tests/full.edit_structured.5 b/src/tests/full.edit_structured.5 index 9a11c67..9488d59 100644 --- a/src/tests/full.edit_structured.5 +++ b/src/tests/full.edit_structured.5 @@ -241,7 +241,7 @@ to
-9-10 €
- + @@ -269,7 +269,7 @@ to
-9-10 €
- + diff --git a/src/tests/full.ledger_raw b/src/tests/full.ledger_raw index 9d2d63a..89896b6 100644 --- a/src/tests/full.ledger_raw +++ b/src/tests/full.ledger_raw @@ -93,14 +93,14 @@ Detected redundant empty lines in gaps, - - - - - - - - - @@ -160,14 +154,14 @@ Detected redundant empty lines in gaps, - - - - - -
-18-19 €
+

+ [#]
[b]
[e] @@ -109,19 +109,18 @@ Detected redundant empty lines in gaps, baz x € 
 
 
+

+ [#]
[b]
[e] @@ -129,7 +128,6 @@ Detected redundant empty lines in gaps, -
+

+ [#]
[b]
[e] @@ -146,12 +146,6 @@ Detected redundant empty lines in gaps, x
€baz
 
+

+ [#]
[b]
[e] @@ -183,12 +177,6 @@ Detected redundant empty lines in gaps, 1.00
€bar
-20.00 €