✔ Add a tests that checks if plain text files with BOM are read correctly

pull/142/head
Mike Gerber 6 days ago
parent 9fc8937324
commit 5639f3db7f

@ -182,3 +182,15 @@ def test_plain(tmp_path):
result = plain_text("ocr.txt")
expected = "First, a line.\nAnd a second line."
assert result == expected
def test_plain_BOM(tmp_path):
"""Test that plain text files with BOM are read correctly."""
BOM = "\ufeff"
with working_directory(tmp_path):
with open("ocr.txt", "w") as ocrf:
ocrf.write(BOM + "First, a line.\nAnd a second line.\n")
result = plain_text("ocr.txt")
expected = "First, a line.\nAnd a second line."
assert result == expected

Loading…
Cancel
Save