Skip to content

Commit

Permalink
Add extrema test
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Oct 13, 2021
1 parent b0b7bc2 commit 283e704
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/filters/addExtrema_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from ufo2ft.filters.addExtrema import AddExtremaFilter


class AddExtremaFilterTest:
def test_add_extrema_O(self, FontClass):
ufo = FontClass()
a = ufo.newGlyph("O")
a.width = 300
pen = a.getPen()
pen.moveTo((150, 0))
pen.curveTo((249, 0), (249, 150), (150, 150))
pen.curveTo((52, 150), (52, 0), (150, 0))
pen.closePath()

contour = ufo["O"][0]
assert len(contour) == 6

filter_ = AddExtremaFilter()

assert filter_(ufo)

contour = ufo["O"][0]
assert len(contour) == 12
ufo.save("t.ufo")

0 comments on commit 283e704

Please sign in to comment.