test: cover AS TO object field annotations
This commit is contained in:
@@ -51,6 +51,12 @@ class ValidateTypecheckDiagnosticsTests(unittest.TestCase):
|
||||
MODULE.EXPECTED_OK,
|
||||
)
|
||||
|
||||
def test_includes_as_to_typed_field_success_fixture(self):
|
||||
self.assertIn(
|
||||
"tests/typecheck_object_field_typed_as_to_good.claro",
|
||||
MODULE.EXPECTED_OK,
|
||||
)
|
||||
|
||||
def test_includes_reverse_text_concatenation_success_fixture(self):
|
||||
self.assertIn(
|
||||
"tests/typecheck_object_field_text_concat_reverse_good.claro",
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
CLASS Player
|
||||
HAS score NUMBER
|
||||
END
|
||||
|
||||
NEW Player player
|
||||
SET player.score AS NUMBER TO 10
|
||||
CHECK TYPE player.score IS NUMBER
|
||||
Reference in New Issue
Block a user