From 576a59b394c1061b48cda17b4bfde4fa28658903 Mon Sep 17 00:00:00 2001 From: Dwight Gunning Date: Thu, 1 Oct 2026 19:20:45 -0400 Subject: [PATCH] test(dt1f1): re-pin the 2010 20-F item lengths after #1361; assert passage counts test_2010_20f_resolves_all_eight_wrapped_items_without_the_legacy_parser has failed locally since #1361 (bf0441b6, bisected from 66e3d481 where the pins held): Item 5 107,457 -> 106,096, Item 6 58,425 -> 57,677, Item 11 7,504 -> 7,081. It skips in CI because its fixture lives in the gitignored text_boundary_corpus, so nobody saw it; #1386 then took 3 whitespace characters off Item 5 (word stream identical). The shrinkage is #1361 removing duplicates, not losing text. Against the source's own item spans: Item 5's technology transfer (July 2009) and W2E license (January 2010) paragraphs occur once and were printed twice; Item 6's "247,900", "Company Headcount", "100,000" (4), "50,000" (11) and "(2)" (15) were each printed once too often; Item 11's forward-contract paragraph ("notional amount of $1,695") occurs once in Item 11 (its other copy is in Item 19's notes) and was printed twice. After #1361 every count matches the source. Re-pinned, with count assertions for those passages so the next change is judged on content rather than length; they fail on bf0441b6~1. The other 40 tests on the ignored corpus pass. Co-Authored-By: Claude Opus 5.5 --- .../test_dt1f1_wrapped_item_headers.py | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tests/issues/regression/test_dt1f1_wrapped_item_headers.py b/tests/issues/regression/test_dt1f1_wrapped_item_headers.py index 4393e8361..e75a5fab1 100644 --- a/tests/issues/regression/test_dt1f1_wrapped_item_headers.py +++ b/tests/issues/regression/test_dt1f1_wrapped_item_headers.py @@ -205,13 +205,21 @@ def test_2010_20f_resolves_all_eight_wrapped_items_without_the_legacy_parser(): # was removed (edgartools-kq2q) -- they are the two that carry tables. The other # six are unchanged, which is the signal that the cap removal touches table # rendering only and moves no item boundary. + # + # Items 5, 6 and 11 then shrank in #1361 (render tables in TOC-path section + # text), which stopped printing passages twice: Item 5's two technology + # agreement paragraphs, Item 6's option-grant notes and compensation cells, + # Item 11's forward-contract paragraph. The counts below match the source's + # own item spans. This test skips in CI (the fixture is gitignored), so the + # pins went stale there; #1386 then took 3 whitespace characters off Item 5. expected = { - "Item 5": 107457, + "Item 5": 106093, # Item 6 moved twice: 57,841 -> 57,861 for kq2q, then -> 58,425 for # y0ri/3cis, which recovers "Headcount", "Bonus", "Shares" and "Common" # label cells and merges "24.8" + "%" into "24.8%". Numbers unchanged. - "Item 6": 58425, - "Item 11": 7504, + # Then -> 57,677 for #1361 (duplicates removed, above). + "Item 6": 57677, + "Item 11": 7081, "Item 12": 152, "Item 15": 14078, "Item 16D": 181, @@ -220,6 +228,16 @@ def test_2010_20f_resolves_all_eight_wrapped_items_without_the_legacy_parser(): } assert {item: len(report[item]) for item in expected} == expected + # Each passage as often as the source's own item span has it (#1361 stopped + # the TOC path printing table-adjacent passages twice) + def count(item, text): + return " ".join(report[item].split()).count(text) + assert count("Item 5", "In July 2009, we entered into a technology transfer agreement") == 1 + assert count("Item 5", "In January 2010, we entered into a technology license agreement") == 1 + assert count("Item 6", "247,900") == 1 + assert count("Item 6", "100,000") == 4 + assert count("Item 11", "notional amount of $1,695") == 1 + # The TOC row for Item 1 carries a page number and must lose to the body # header, which is a 146-character "not applicable" stub. assert len(report["Item 1"]) == 146