test: require complete typecheck fixture coverage
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Regression tests for complete typecheck fixture coverage."""
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
SPEC = importlib.util.spec_from_file_location(
|
||||
"validate_typecheck_diagnostics", ROOT / "tools" / "validate_typecheck_diagnostics.py"
|
||||
)
|
||||
MODULE = importlib.util.module_from_spec(SPEC)
|
||||
SPEC.loader.exec_module(MODULE)
|
||||
|
||||
|
||||
class ValidateTypecheckDiagnosticsTests(unittest.TestCase):
|
||||
def test_lists_every_typecheck_fixture(self):
|
||||
listed = set(MODULE.EXPECTED) | set(MODULE.EXPECTED_OK)
|
||||
fixtures = {
|
||||
str(path.relative_to(ROOT))
|
||||
for path in (ROOT / "tests").glob("typecheck_*.claro")
|
||||
}
|
||||
fixtures.add("tests/37_object_field_types.claro")
|
||||
self.assertEqual(listed, fixtures)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user