test: cover compatibility method multiplication diagnostics
This commit is contained in:
@@ -140,6 +140,12 @@ class ValidateTypecheckDiagnosticsTests(unittest.TestCase):
|
||||
MODULE.EXPECTED,
|
||||
)
|
||||
|
||||
def test_includes_compatibility_method_multiplication_return_diagnostic_fixture(self):
|
||||
self.assertIn(
|
||||
"tests/typecheck_method_compat_return_multiplication_bad.claro",
|
||||
MODULE.EXPECTED,
|
||||
)
|
||||
|
||||
def test_includes_lowercase_compatibility_method_return_success_fixture(self):
|
||||
self.assertIn(
|
||||
"tests/typecheck_method_compat_lowercase_return_good.claro",
|
||||
@@ -165,6 +171,10 @@ class ValidateTypecheckDiagnosticsTests(unittest.TestCase):
|
||||
'"tests/typecheck_method_compat_lowercase_return_good.claro"',
|
||||
(ROOT / "src" / "claro.c").read_text(),
|
||||
)
|
||||
self.assertIn(
|
||||
'"tests/typecheck_method_compat_return_multiplication_bad.claro"',
|
||||
(ROOT / "src" / "claro.c").read_text(),
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
CLASS Player
|
||||
TEACH total TAKES amount RETURNS NUMBER
|
||||
CHECK TYPE amount IS NUMBER
|
||||
RETURN amount * "oops"
|
||||
LEARNED
|
||||
ENDCLASS
|
||||
Reference in New Issue
Block a user