From d2b3e60bbbb78f4ad1626b6aa8ffc15ca2bf3ed4 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Fri, 14 Jul 2017 03:57:07 -0700 Subject: [PATCH] test for issue #2614 --- Tests/test_imagefont.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tests/test_imagefont.py b/Tests/test_imagefont.py index 12b687c3b..fde312f44 100644 --- a/Tests/test_imagefont.py +++ b/Tests/test_imagefont.py @@ -393,6 +393,11 @@ class TestImageFont(PillowTestCase): # Assert self.assert_image_equal(im, target_img) + def test_getsize_empty(self): + font = self.get_font() + # should not crash. + self.assertEqual((0, 0), font.getsize('')) + def _test_fake_loading_font(self, path_to_fake, fontname): # Make a copy of FreeTypeFont so we can patch the original free_type_font = copy.deepcopy(ImageFont.FreeTypeFont)