test: cover lowercase compatibility method returns
This commit is contained in:
@@ -80,6 +80,12 @@ class ValidateTypecheckDiagnosticsTests(unittest.TestCase):
|
||||
def test_includes_compatibility_method_return_success_fixture(self):
|
||||
self.assertIn("tests/typecheck_method_compat_return_good.claro", MODULE.EXPECTED_OK)
|
||||
|
||||
def test_includes_lowercase_compatibility_method_return_success_fixture(self):
|
||||
self.assertIn(
|
||||
"tests/typecheck_method_compat_lowercase_return_good.claro",
|
||||
MODULE.EXPECTED_OK,
|
||||
)
|
||||
|
||||
def test_includes_compatibility_missing_method_argument_fixture(self):
|
||||
self.assertIn(
|
||||
"tests/typecheck_method_call_missing_unchecked_arg_bad.claro",
|
||||
@@ -95,6 +101,10 @@ class ValidateTypecheckDiagnosticsTests(unittest.TestCase):
|
||||
)
|
||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||
self.assertIn("tests/typecheck_method_call_bad.claro", result.stdout)
|
||||
self.assertIn(
|
||||
'"tests/typecheck_method_compat_lowercase_return_good.claro"',
|
||||
(ROOT / "src" / "claro.c").read_text(),
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
CLASS Player
|
||||
TEACH score TAKES amount returns NUMBER
|
||||
CHECK TYPE amount IS NUMBER
|
||||
RETURN amount
|
||||
LEARNED
|
||||
END
|
||||
|
||||
NEW Player player
|
||||
CALL player.score WITH 4
|
||||
Reference in New Issue
Block a user