diff --git a/tests/36_object_methods.claro b/tests/36_object_methods.claro new file mode 100644 index 0000000..7f0bf30 --- /dev/null +++ b/tests/36_object_methods.claro @@ -0,0 +1,25 @@ +CLASS Player + HAS name TEXT + HAS score NUMBER + + TEACH show + SAY name + SAY score + END + + TEACH add points + SET score score + points + END +END + +NEW Player player +SET player.name "Jon" +SET player.score 10 +DO player.show +DO player.add 5 +SAY player.score +OBJECT CLASS player AS kind +SAY kind +OBJECT FIELDS player AS fields +COUNT fields AS total +SAY total