test: cover compatibility function missing returns

This commit is contained in:
Hermes Agent
2026-09-19 12:01:25 +00:00
parent 30713c71c1
commit 1bc11207ef
6 changed files with 22 additions and 3 deletions
@@ -226,6 +226,12 @@ class ValidateTypecheckDiagnosticsTests(unittest.TestCase):
MODULE.EXPECTED_OK,
)
def test_includes_compatibility_function_missing_return_fixture(self):
self.assertIn(
"tests/typecheck_function_compat_missing_return_bad.claro",
MODULE.EXPECTED,
)
def test_includes_lowercase_compatibility_method_return_success_fixture(self):
self.assertIn(
"tests/typecheck_method_compat_lowercase_return_good.claro",
@@ -360,6 +366,13 @@ class ValidateTypecheckDiagnosticsTests(unittest.TestCase):
):
self.assertIn(f'"{fixture}"', source)
def test_release_validation_runs_compatibility_function_missing_return_fixture(self):
source = (ROOT / "src" / "claro.c").read_text()
self.assertIn(
'"tests/typecheck_function_compat_missing_return_bad.claro"',
source,
)
def test_release_validation_runs_method_call_fixture(self):
result = subprocess.run(
[str(ROOT / "claro"), "validate"],
@@ -0,0 +1,3 @@
TEACH square TAKES amount RETURNS NUMBER
CHECK TYPE amount IS NUMBER
LEARNED