From cc76169074fd1835cfb393a8e4a5faa4336c9402 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Mon, 22 Mar 2021 16:47:44 +0000 Subject: [PATCH] Test that G* table compilation does not change data --- Tests/feaLib/builder_test.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Tests/feaLib/builder_test.py b/Tests/feaLib/builder_test.py index 2f6319e62..35bbab9a1 100644 --- a/Tests/feaLib/builder_test.py +++ b/Tests/feaLib/builder_test.py @@ -142,10 +142,15 @@ class BuilderTest(unittest.TestCase): feapath = self.getpath("%s.fea" % name) addOpenTypeFeatures(font, feapath) self.expect_ttx(font, self.getpath("%s.ttx" % name)) - # Make sure we can produce binary OpenType tables, not just XML. + # Check that + # 1) tables do compile (only G* tables as long as we have a mock font) + # 2) dumping after save-reload yields the same TTX dump as before for tag in ('GDEF', 'GSUB', 'GPOS'): if tag in font: - font[tag].compile(font) + data = font[tag].compile(font) + font[tag].decompile(data, font) + self.expect_ttx(font, self.getpath("%s.ttx" % name)) + # Optionally check a debug dump. debugttx = self.getpath("%s-debug.ttx" % name) if os.path.exists(debugttx): addOpenTypeFeatures(font, feapath, debug=True)