test: cover compatibility method field returns
This commit is contained in:
@@ -107,6 +107,10 @@ class ValidateTypecheckDiagnosticsTests(unittest.TestCase):
|
||||
self.assertIn("tests/typecheck_method_field_return_bad.claro", MODULE.EXPECTED)
|
||||
self.assertIn("tests/typecheck_method_field_return_good.claro", MODULE.EXPECTED_OK)
|
||||
|
||||
def test_includes_compatibility_method_field_return_fixtures(self):
|
||||
self.assertIn("tests/typecheck_method_compat_field_return_bad.claro", MODULE.EXPECTED)
|
||||
self.assertIn("tests/typecheck_method_compat_field_return_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
CLASS Player
|
||||
HAS score NUMBER
|
||||
|
||||
TEACH label TAKES amount RETURNS TEXT
|
||||
RETURN score
|
||||
LEARNED
|
||||
ENDCLASS
|
||||
@@ -0,0 +1,10 @@
|
||||
CLASS Player
|
||||
HAS score NUMBER
|
||||
|
||||
TEACH score_value TAKES amount RETURNS NUMBER
|
||||
RETURN score
|
||||
LEARNED
|
||||
ENDCLASS
|
||||
|
||||
NEW Player player
|
||||
CALL player.score_value WITH 4
|
||||
Reference in New Issue
Block a user