Skip to content

Commit 51bb944

Browse files
committed
Fix test_wrap_height expectations for increased line spacing
The descender-aware line spacing (A→Aj) correctly increases the vertical space each line occupies. This means wrap() with height limits fits fewer lines than before, which is the correct behavior. Updated 3 assertions: - Case 1: ' within height' → ' not fit within height', remaining adjusted - Case 3: '\nwithin height' → ' not fit\n\nwithin height', remaining adjusted - Case 2: unchanged (already correct)
1 parent c1c72c7 commit 51bb944

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Tests/test_imagetext.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ def test_wrap_height() -> None:
154154
text = ImageText.Text("Text does not fit within height")
155155
wrapped = text.wrap(width, 25 if features.check_module("freetype2") else 40)
156156
assert wrapped is not None
157-
assert wrapped.text == " within height"
158-
assert text.text == "Text does\nnot fit"
157+
assert wrapped.text == " not fit within height"
158+
assert text.text == "Text does"
159159

160160
text = ImageText.Text("Text does not fit\nwithin height")
161161
wrapped = text.wrap(width, 20)
@@ -166,8 +166,8 @@ def test_wrap_height() -> None:
166166
text = ImageText.Text("Text does not fit\n\nwithin height")
167167
wrapped = text.wrap(width, 25 if features.check_module("freetype2") else 40)
168168
assert wrapped is not None
169-
assert wrapped.text == "\nwithin height"
170-
assert text.text == "Text does\nnot fit"
169+
assert wrapped.text == " not fit\n\nwithin height"
170+
assert text.text == "Text does"
171171

172172

173173
def test_wrap_scaling_unsupported() -> None:

0 commit comments

Comments
 (0)