Skip to content

Commit a15141d

Browse files
committed
fix index error, break out of loop after first run
1 parent e9549ed commit a15141d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/test_checks_name.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,13 @@ def test_check_name_family_and_style_max_length(check):
241241
bad = "Absurdly Long Name Particle"
242242
assert len(bad) == 27
243243

244-
name = ttFont["name"].getName(value.ValueNameID, 3, 1, 0x409)
244+
# edit the name table entry for the STAT style name
245+
for index, name in enumerate(ttFont["name"].names):
246+
if name.nameID == value.ValueNameID:
247+
ttFont["name"].names[index].string = bad.encode(name.getEncoding())
245248

246-
ttFont["name"].names[value.ValueNameID].string = bad.encode(name.getEncoding())
249+
# stop after the first applicable STAT value
250+
break
247251

248252
results = check(ttFont)
249253
assert_results_contain(

0 commit comments

Comments
 (0)