develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r36105 - trunk/t/oo

From:
Whiteknight
Date:
January 28, 2009 11:04
Subject:
[svn:parrot] r36105 - trunk/t/oo
Message ID:
20090128190252.02A48CB9AE@x12.develooper.com
Author: Whiteknight
Date: Wed Jan 28 11:02:51 2009
New Revision: 36105

Modified:
   trunk/t/oo/vtableoverride.t

Log:
[t] Adding some hypothetical tests for the "invoke" vtable override. These tests should pass once ticket TT#103 is finally resolved.

Modified: trunk/t/oo/vtableoverride.t
==============================================================================
--- trunk/t/oo/vtableoverride.t	(original)
+++ trunk/t/oo/vtableoverride.t	Wed Jan 28 11:02:51 2009
@@ -53,6 +53,15 @@
     $P0 = getattribute $P1, "message"
     $S0 = $P0
     is($S0, "Morphing [MyObject] to type Integer", "Morph VTABLE override 1")
+    
+    # Test invoke. Doesn't currently work so we need to fix that.
+    #$P0 = $P1("invoked!")
+    #$S0 = $P0
+    #is($S0, "invoked!", "Invoke VTABLE override return value")
+    
+    #$P0 = getattribute $P1, "message"
+    #$S0 = $P0
+    #is($S0, "invoked!", "Invoke VTABLE override sideeffects")
 .end
 
 .sub 'subclass_tests'
@@ -116,6 +125,13 @@
     .return (1)
 .end
 
+.sub 'invoke' :vtable
+    .param string msg
+    $P0 = box msg
+    setattribute self, "message", $P0
+    .return($P0)
+.end
+
 .namespace [ 'MySubObject' ]
 
 .sub '__onload' :anon :init



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About