summaryrefslogtreecommitdiffstats
path: root/tests/012
diff options
context:
space:
mode:
Diffstat (limited to 'tests/012')
-rw-r--r--tests/012/oop.tl10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/012/oop.tl b/tests/012/oop.tl
index 5cdd3ec3..8bf8b4b4 100644
--- a/tests/012/oop.tl
+++ b/tests/012/oop.tl
@@ -149,3 +149,13 @@
c.(tweak) :error
c.(increment 1) (api-z increment #S(api-z) 1)
c.(decrement) :error))
+
+(defstruct node ()
+ left right)
+
+(test (copy (new node left 1 right 2)) #S(node left 1 right 2))
+
+(defmeth node copy (me)
+ (new node left (succ me.left) right (succ me.right)))
+
+(test (copy (new node left 1 right 2)) #S(node left 2 right 3))