Codex
代码聚焦 reconcile.py,新建独立回归明确覆盖复用字典和调用方 Decimal 上下文。首交公开测试 4 条。
reconcile.py、test_reconcile_regression.py
diff --git a/reconcile.py b/reconcile.py
index a0ceeb8..1a713b2 100644
--- a/reconcile.py
+++ b/reconcile.py
+class ReconcileRegressionTests(unittest.TestCase):
+ def test_revision_winners_from_reused_buffer(self):
+ def test_exact_totals_and_rounding_ignore_decimal_context(self):
+ """Return the rounded total per vendor for the latest active invoices."""
+ revision = int(row["revision"])
+ if previous is None or revision >= previous[0]:
+ latest[key] = (revision, row["status"].strip().lower(), row.get("amount"))
+ totals = {}Cursor
保留原测试效果,在 test_reconcile.py 增加标识、舍入和一次性输入回归。首交公开测试 9 条。
reconcile.py、test_reconcile.py
diff --git a/reconcile.py b/reconcile.py
index a0ceeb8..b9d2cb9 100644
--- a/reconcile.py
+++ b/reconcile.py
+def _text(value, name):
+def _revision(value):
+def _units(value):
+def _r(buyer, vendor, invoice, revision, status, amount):
+class MergeRuleTests(TestCase):
+ def test_same_invoice_in_two_buyers_both_count(self):
+ def test_revision_numeric_and_ties_last_wins(self):
+ def test_void_winner_and_restore(self):
GitHub Copilot
将最新修订按采购主体隔开。首交 5 条测试,覆盖金额上下文和复用输入。
reconcile.py、test_reconcile.py
diff --git a/reconcile.py b/reconcile.py
index a0ceeb8..f19b272 100644
--- a/reconcile.py
+++ b/reconcile.py
+ def test_winners_are_scoped_by_buyer_and_void_winners_are_ignored(self):
+ def test_reused_input_mapping_is_snapshotted(self):
+ def test_exact_totals_and_half_up_are_independent_of_decimal_context(self):
+ """Return the rounded total per vendor for each winning invoice."""
+ winners = {}
+ revision = row["revision"]
+ if isinstance(revision, int) and not isinstance(revision, bool):
+ revision_number = revisionOpenCode
仅改归并函数和独立回归。9 条公开测试覆盖同修订顺序、作废恢复和舍入。
reconcile.py、test_reconcile_regression.py
diff --git a/reconcile.py b/reconcile.py
index a0ceeb8..5425802 100644
--- a/reconcile.py
+++ b/reconcile.py
+def _revision(value):
+def _scaled_amount(amount):
+def _to_cents(micro):
+def _format_cents(cents):
+class ReconcileRegressionTests(TestCase):
+ def test_finance_incident_groups_by_buyer_and_revision(self):
+ def test_void_winner_removes_invoice_until_a_later_ok_revision(self):
+ def test_equal_revision_uses_last_arrival(self):
Cline
补丁可应用。原样例仍给出 MX 160.01 元,9 条首交公开测试通过,包含修订与作废场景。
reconcile.py、test_reconcile.py
diff --git a/reconcile.py b/reconcile.py
index a0ceeb8..2fa0485 100644
--- a/reconcile.py
+++ b/reconcile.py
+def _parse_revision(rev):
+ def test_revision_winning_over_void(self):
+ def test_higher_revision_restored_ok(self):
+ def test_buyer_normalisation_strips_whitespace(self):
+ def test_buyer_missing_treated_as_MAIN(self):
+ def test_same_invoice_different_buyers_grouped_separately(self):
+ def test_void_winning_record_excludes_invoice(self):
+ def test_rounding_half_up(self):
CodeBuddy(腾讯云代码助手)
单个归并实现配独立 test_contract.py,11 条公开测试覆盖跨主体、负微额和旧格式。
reconcile.py、test_contract.py
diff --git a/reconcile.py b/reconcile.py
--- a/reconcile.py
+++ b/reconcile.py
@@ -1,10 +1,33 @@
+def reconcile(rows):
+class ContractTests(unittest.TestCase):
+ def test_incident_cross_buyer_revision_and_void(self):
+ def test_status_normalised_case_and_whitespace(self):
+ def test_void_winner_then_higher_revision_restores(self):
+ def test_all_void_vendor_absent_and_negative_micro_zero(self):
+ def test_half_up_away_from_zero_both_signs(self):
+ def test_independent_of_caller_decimal_context(self):
OpenHands
从原始 ZIP 建独立云环境,21 条公开测试、17 项私有契约和原生 git apply 复验通过。
reconcile.py、test_ticket.py
diff --git a/reconcile.py b/reconcile.py
index a0ceeb8..af227ae 100644
--- a/reconcile.py
+++ b/reconcile.py
+def _text(value):
+def _buyer(row):
+def _revision(value):
+def _status(value):
+def _amount(value):
+def _to_cents(total):
+class WinnerSelectionTests(unittest.TestCase):
+ def test_highest_revision_wins_within_buyer(self):