Skip to content

Commit

Permalink
Test that subsequent compile() calls do not change anything
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 21, 2025
1 parent 769a14d commit ae7c492
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Tests/test_fontfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@

import pytest

from PIL import FontFile
from PIL import FontFile, Image


def test_compile() -> None:
font = FontFile.FontFile()
font.glyph[0] = ((0, 0), (0, 0, 0, 0), (0, 0, 0, 1), Image.new("L", (0, 0)))
font.compile()
assert font.ysize == 1

font.ysize = 2
font.compile()

# Assert that compiling again did not change anything
assert font.ysize == 2


def test_save(tmp_path: Path) -> None:
Expand Down

0 comments on commit ae7c492

Please sign in to comment.