Skip to content

Commit

Permalink
Test comment that ends in the same block
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jun 13, 2022
1 parent 0b76b7e commit 0f7e75e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Tests/test_file_ppm.py
Expand Up @@ -133,13 +133,20 @@ def test_16bit_plain_pgm():


@pytest.mark.parametrize(
"header, data",
((b"P1\n2 2", b"1010"), (b"P3\n2 2\n255", b"0 0 0 001 1 1 2 2 2 255 255 255")),
"header, data, comment",
(
(b"P1\n2 2", b"1010", b"# veeery long comment" * 10**6),
(b"P2\n3 1\n4", b"0 2 4", b"# comment"),
(
b"P3\n2 2\n255",
b"0 0 0 001 1 1 2 2 2 255 255 255",
b"# veeery long comment" * 10**6,
),
),
)
def test_plain_data_with_comments(tmp_path, header, data):
def test_plain_data_with_comment(tmp_path, header, data, comment):
path1 = str(tmp_path / "temp1.ppm")
path2 = str(tmp_path / "temp2.ppm")
comment = b"# veeery long comment" * 10**6
with open(path1, "wb") as f1, open(path2, "wb") as f2:
f1.write(header + b"\n\n" + data)
f2.write(header + b"\n" + comment + b"\n" + data + comment)
Expand Down

0 comments on commit 0f7e75e

Please sign in to comment.