Skip to content

Commit fb04f09

Browse files
committed
Also test that cindex.py contains no superfluous variants
1 parent ad6ab77 commit fb04f09

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

clang/bindings/python/tests/cindex/test_enums.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,17 @@ def test_all_variants(self):
8181
for enum in self.enums:
8282
with self.subTest(enum):
8383
python_kinds = set([kind.value for kind in enum])
84-
c_kinds = set(enum_variant_map[enum])
84+
# Defined in Index.h but not in cindex.py
8585
missing_python_kinds = c_kinds - python_kinds
8686
self.assertEqual(
8787
missing_python_kinds,
8888
set(),
8989
f"Please ensure these are defined in {enum} in cindex.py.",
9090
)
91+
# Defined in cindex.py but not in Index.h
92+
superfluous_python_kinds = python_kinds - c_kinds
93+
self.assertEqual(
94+
superfluous_python_kinds,
95+
set(),
96+
f"Please ensure that all {enum} kinds defined in cindex.py have an equivalent in Index.h",
97+
)

0 commit comments

Comments
 (0)