Skip to content

Commit 6eb6232

Browse files
committed
Test comment that ends in the same block
1 parent 216cd37 commit 6eb6232

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Tests/test_file_ppm.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,17 @@ def test_16bit_plain_pgm():
133133

134134

135135
@pytest.mark.parametrize(
136-
"header, data",
137-
((b"P1\n2 2", b"1010"), (b"P3\n2 2\n255", b"0 0 0 001 1 1 2 2 2 255 255 255")),
136+
"header, data, comment_count",
137+
(
138+
(b"P1\n2 2", b"1010", 10**6),
139+
(b"P2\n3 1\n4", b"0 2 4", 1),
140+
(b"P3\n2 2\n255", b"0 0 0 001 1 1 2 2 2 255 255 255", 10**6),
141+
),
138142
)
139-
def test_plain_data_with_comments(tmp_path, header, data):
143+
def test_plain_data_with_comment(tmp_path, header, data, comment_count):
140144
path1 = str(tmp_path / "temp1.ppm")
141145
path2 = str(tmp_path / "temp2.ppm")
142-
comment = b"# veeery long comment" * 10**6
146+
comment = b"# comment" * comment_count
143147
with open(path1, "wb") as f1, open(path2, "wb") as f2:
144148
f1.write(header + b"\n\n" + data)
145149
f2.write(header + b"\n" + comment + b"\n" + data + comment)

0 commit comments

Comments
 (0)