aboutsummaryrefslogtreecommitdiff
path: root/tests/i/class-new-methods/program.cps
diff options
context:
space:
mode:
Diffstat (limited to 'tests/i/class-new-methods/program.cps')
-rw-r--r--tests/i/class-new-methods/program.cps16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/i/class-new-methods/program.cps b/tests/i/class-new-methods/program.cps
new file mode 100644
index 0000000..573fe0f
--- /dev/null
+++ b/tests/i/class-new-methods/program.cps
@@ -0,0 +1,16 @@
+CLASS Box
+ Value : STRING
+ PROCEDURE NEW(Text : STRING)
+ Value <- Text
+ ENDPROCEDURE
+ PROCEDURE Reset()
+ this.NEW("again")
+ ENDPROCEDURE
+ENDCLASS
+DECLARE Obj : Box
+Obj.NEW("x")
+OUTPUT Obj.Value
+CALL Obj.new("call")
+OUTPUT Obj.Value
+Obj.Reset()
+OUTPUT Obj.Value