test: cover unknown method return expressions

This commit is contained in:
Hermes Agent
2026-09-11 05:25:39 +00:00
parent 34f96a6d7d
commit c82d67a34a
7 changed files with 44 additions and 3 deletions
@@ -87,6 +87,16 @@ class ValidateTypecheckDiagnosticsTests(unittest.TestCase):
self.assertIn("tests/typecheck_method_return_expression_bad.claro", MODULE.EXPECTED)
self.assertIn("tests/typecheck_method_return_expression_good.claro", MODULE.EXPECTED_OK)
def test_includes_unknown_method_return_expression_fixtures(self):
self.assertIn(
"tests/typecheck_method_unknown_return_expression_bad.claro",
MODULE.EXPECTED,
)
self.assertIn(
"tests/typecheck_method_unknown_return_expression_good.claro",
MODULE.EXPECTED_OK,
)
def test_includes_method_field_return_diagnostic_fixture(self):
self.assertIn("tests/typecheck_method_field_return_bad.claro", MODULE.EXPECTED)
self.assertIn("tests/typecheck_method_field_return_good.claro", MODULE.EXPECTED_OK)
@@ -0,0 +1,6 @@
CLASS Player
TEACH square amount RETURNS NUMBER
CHECK TYPE amount IS NUMBER
RETURN missing
END
END
@@ -0,0 +1,6 @@
CLASS Player
TEACH square amount RETURNS NUMBER
CHECK TYPE amount IS NUMBER
RETURN amount
END
END