Skip to content

Commit

Permalink
classes_test: repro LayersIterator error with 'orphan' GSGlyph
Browse files Browse the repository at this point in the history
reproduces #1013
  • Loading branch information
anthrotype committed Jul 31, 2024
1 parent 280c208 commit e7d6084
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/classes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,17 @@ def test_append_layer_same_id(self):
font.masters.append(master2)
assert len({m.id for m in font.masters}) == 2

def test_iterate_layers_of_orphan_glyph(self):
# https://github.com/googlefonts/glyphsLib/issues/1013
glyph = GSGlyph()
assert glyph.parent is None
layer = GSLayer()
glyph.layers.append(layer)
assert layer.parent is glyph
# this ought not to raise a `KeyError: 0` exception
layers = list(glyph.layers)
assert layers[0] is layer


class GSFontTest(unittest.TestCase):
def test_init(self):
Expand Down

0 comments on commit e7d6084

Please sign in to comment.