Skip to content

Commit

Permalink
tests/test_toc.py:test_full_toc(): cope with line endings on github w…
Browse files Browse the repository at this point in the history
…in32 machines.

Github windows x32 machines seem to insert \r characters when reading text
files.
  • Loading branch information
julian-smith-artifex-com committed Mar 26, 2024
1 parent c83d623 commit 9c4e23d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ def test_full_toc():
return
expected_path = f"{scriptdir}/resources/full_toc.txt"
expected = pathlib.Path(expected_path).read_bytes()
# Github windows x32 seems to insert \r characters; maybe something to
# do with the Python installation's line endings settings.
expected = expected.decode("utf8")
expected = expected.replace('\r', '')
toc = "\n".join([str(t) for t in doc.get_toc(False)])
toc += "\n"
assert toc == expected.decode("utf8")
assert toc == expected


def test_erase_toc():
Expand Down

0 comments on commit 9c4e23d

Please sign in to comment.