fix(tests): use line-level PDF marker assertion

Updates the PDF marker regression test to check corrupted markers at line level instead of using a broad substring assertion. Restores one focused part of the Python CI baseline tracked in #2580.
This commit is contained in:
Alexandre Teixeira
2026-06-04 18:20:41 +01:00
committed by GitHub
parent 20cc23c9bd
commit 7ce6ec7f50

View File

@@ -50,8 +50,9 @@ def test_pdf_body_marker_stripped_without_eating_text(monkeypatch, tmp_path):
)
body = content[0]["text"] if isinstance(content, list) else content
# The leading page text must survive intact.
assert "[Page 1 text]:" in body
assert "to the board, the agenda is set" in body
# The old lstrip(chars) corruption ate "[P" then "to" -> "age 1 text]: the board".
assert "age 1 text" not in body
body_lines = body.splitlines()
# The leading page marker and page text must survive intact.
assert "[Page 1 text]:" in body_lines
assert "to the board, the agenda is set" in body_lines
# The old lstrip(chars) corruption produced a line like "age 1 text]:" (missing "[P").
assert "age 1 text]:" not in body_lines