mirror of
https://github.com/qurator-spk/dinglehopper.git
synced 2025-06-10 12:19:59 +02:00
✔ Add a tests that checks if plain text files with BOM are read correctly
This commit is contained in:
parent
9fc8937324
commit
5639f3db7f
1 changed files with 12 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue