builder_test: test ClassDef sets with same length, to check deterministic sorting between python 2/3

See issue #766
This commit is contained in:
Cosimo Lupo 2016-12-13 16:38:24 +00:00
parent fa03f469c2
commit 0e3c6eeaec
No known key found for this signature in database
GPG Key ID: B61AAAD0B53A6419

View File

@ -1013,15 +1013,18 @@ class BuilderTest(unittest.TestCase):
class ClassDefBuilderTest(unittest.TestCase):
def test_build_usingClass0(self):
b = builder.ClassDefBuilder(useClass0=True)
b.add({"aa", "bb"})
b.add({"a", "b"})
b.add({"c"})
b.add({"e", "f", "g", "h"})
cdef = b.build()
self.assertIsInstance(cdef, otTables.ClassDef)
self.assertEqual(cdef.classDefs, {
"a": 1,
"b": 1,
"c": 2
"a": 2,
"b": 2,
"c": 3,
"aa": 1,
"bb": 1
})
def test_build_notUsingClass0(self):