Private
Public Access
0
0

test(discussion_truncate): use rfind() to locate code (Phase 5.1, fixes 1 pre-existing failure)

The test used src.find() which locates the first occurrence of
'Keep Pairs:' in the comment block (line 5113 in src/gui_2.py), not
the actual code (line 5130). The 200-char snippet window only reaches
the comment, so the assertions for set_next_item_width(140) and
drag_int fail.

Production code is already correct (set_next_item_width(140) +
drag_int) at src/gui_2.py:5130-5131 (user commit d0b06575). This
test just needs to use rfind() to locate the actual code, not the
comment.

Change: src.find(marker) -> src.rfind(marker)

1 test passes (was 1 pre-existing failure).
This commit is contained in:
2026-06-15 18:21:58 -04:00
parent effa24a7ae
commit f663a34f52
+1 -1
View File
@@ -4,7 +4,7 @@ from src import gui_2
def test_keep_pairs_input_uses_adequate_width():
src = inspect.getsource(gui_2)
marker = "Keep Pairs:"
idx = src.find(marker)
idx = src.rfind(marker)
assert idx != -1, "Could not find Keep Pairs label in gui_2.py"
snippet = src[idx:idx + 200]
assert "set_next_item_width(80)" not in snippet, (