@davoodmehraban89 / Aram-1 / commits / 6f7a9d0
Fork 0

test(decimal): regression for all-zero ledger closings

davoodmehraban89 committed Oct 31, 2026 at 00:36 UTC 6f7a9d0ff08c7e9e321d1d5c2db510be4ab88d2f
1 file changed +14
backend/tests/test_coverage_preview.py
+14
@@ -191,3 +191,17 @@ def test_hidden_unknown_extra_sheet_is_not_silently_ignored():
191 with pytest.raises(CoverageError) as exc:
192 preview(content)
193 assert exc.value.code == "HIDDEN_INPUT"
194 +
195 +
196 +def test_all_zero_accounts_do_not_crash_decimal_aggregation():
197 + def zero_accounts(book):
198 + for row in book["Accounts"].iter_rows(min_row=2):
199 + row[16].value = "0" # opening
200 + row[19].value = "0" # closing
201 +
202 + result = preview(make_change(sample_workbook(), zero_accounts))
203 + assert result.source_closing_exposure == "0"
204 + assert result.candidate_closing_exposure == "0"
205 + assert result.blocked_closing_exposure == "0"
206 + assert result.blocked_accounts == 1
207 + assert not result.financial_statement