Private
Public Access
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:
@@ -4,7 +4,7 @@ from src import gui_2
|
|||||||
def test_keep_pairs_input_uses_adequate_width():
|
def test_keep_pairs_input_uses_adequate_width():
|
||||||
src = inspect.getsource(gui_2)
|
src = inspect.getsource(gui_2)
|
||||||
marker = "Keep Pairs:"
|
marker = "Keep Pairs:"
|
||||||
idx = src.find(marker)
|
idx = src.rfind(marker)
|
||||||
assert idx != -1, "Could not find Keep Pairs label in gui_2.py"
|
assert idx != -1, "Could not find Keep Pairs label in gui_2.py"
|
||||||
snippet = src[idx:idx + 200]
|
snippet = src[idx:idx + 200]
|
||||||
assert "set_next_item_width(80)" not in snippet, (
|
assert "set_next_item_width(80)" not in snippet, (
|
||||||
|
|||||||
Reference in New Issue
Block a user