[svn:parrot] r39571 - trunk/t/library

barney at svn.parrot.org barney at svn.parrot.org
Mon Jun 15 13:24:41 UTC 2009


Author: barney
Date: Mon Jun 15 13:24:40 2009
New Revision: 39571
URL: https://trac.parrot.org/parrot/changeset/39571

Log:
Add test for registering a parrotclass.

Modified:
   trunk/t/library/p6object.t

Modified: trunk/t/library/p6object.t
==============================================================================
--- trunk/t/library/p6object.t	Mon Jun 15 13:09:52 2009	(r39570)
+++ trunk/t/library/p6object.t	Mon Jun 15 13:24:40 2009	(r39571)
@@ -1,5 +1,5 @@
 #!./parrot
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -26,7 +26,7 @@
     test_namespace.'export_to'(curr_namespace, exports)
 
     ##  set our plan
-    plan(234)
+    plan(252)
 
     ##  make sure we can load the P6object library
     push_eh load_fail
@@ -460,6 +460,15 @@
     $I0 = isnull $P0
     ok($I0, ".new_class didn't store ['parrot'], 'WXY'")
     p6obj_tests(wxyproto, 'WXY', 'isa'=>'WXY P6object', 'can'=>'foo')
+
+    ## build a Parrotclass
+    .local pmc vwx_nsarray, vwx_ns, vwx_parrotclass, vwx_proto 
+    vwx_nsarray = new 'ResizablePMCArray'
+    push vwx_nsarray, 'VWX'
+    vwx_ns = get_hll_namespace vwx_nsarray
+    vwx_parrotclass = newclass vwx_ns
+    vwx_proto = p6meta.'register'(vwx_parrotclass)
+    p6obj_tests(vwx_proto, 'VWX', 'can'=>'foo')
 .end
 
 .namespace ['XYZ']
@@ -472,6 +481,11 @@
     .return ('WXY::foo')
 .end
 
+.namespace ['VWX']
+.sub 'foo' :method
+    .return ('WXY::foo')
+.end
+
 =back
 
 =cut


More information about the parrot-commits mailing list