test: cover compatibility method return success
This commit is contained in:
@@ -60,6 +60,9 @@ 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_compatibility_method_return_success_fixture(self):
|
||||
self.assertIn("tests/typecheck_method_compat_return_good.claro", MODULE.EXPECTED_OK)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
CLASS Player
|
||||
TEACH score TAKES amount RETURNS NUMBER
|
||||
CHECK TYPE amount IS NUMBER
|
||||
RETURN amount
|
||||
LEARNED
|
||||
ENDCLASS
|
||||
|
||||
NEW Player player
|
||||
CALL player.score WITH 4
|
||||
Reference in New Issue
Block a user