[svn:parrot] r48883 - in trunk: src/pmc t/pmc

whiteknight at svn.parrot.org whiteknight at svn.parrot.org
Thu Sep 9 13:45:02 UTC 2010


Author: whiteknight
Date: Thu Sep  9 13:45:02 2010
New Revision: 48883
URL: https://trac.parrot.org/parrot/changeset/48883

Log:
add a does scalar to Complex as well, which is needed for some reason. Add tests for the new 'complex' role I added

Modified:
   trunk/src/pmc/complex.pmc
   trunk/t/pmc/complex.t

Modified: trunk/src/pmc/complex.pmc
==============================================================================
--- trunk/src/pmc/complex.pmc	Thu Sep  9 13:21:40 2010	(r48882)
+++ trunk/src/pmc/complex.pmc	Thu Sep  9 13:45:02 2010	(r48883)
@@ -301,7 +301,7 @@
 }
 
 
-pmclass Complex provides complex auto_attrs {
+pmclass Complex provides complex provides scalar auto_attrs {
 
     ATTR FLOATVAL re; /* real part */
     ATTR FLOATVAL im; /* imaginary part */

Modified: trunk/t/pmc/complex.t
==============================================================================
--- trunk/t/pmc/complex.t	Thu Sep  9 13:21:40 2010	(r48882)
+++ trunk/t/pmc/complex.t	Thu Sep  9 13:45:02 2010	(r48883)
@@ -21,7 +21,7 @@
     .include 'fp_equality.pasm'
     .include "iglobals.pasm"
 
-    plan(458)
+    plan(460)
 
     string_parsing()
     exception_malformed_string__real_part()
@@ -76,6 +76,7 @@
     sech_of_complex_numbers()
     csch_of_complex_numbers()
     add_using_subclass_of_complex_bug_59630()
+    provides_complex()
 
     # END_OF_TESTS
 
@@ -514,10 +515,10 @@
     .local int bool1
 
     does bool1, pmc1, "scalar"
-    ok( bool1, 'Comples does scalar' )
+    ok( bool1, 'Complex does scalar' )
 
     does bool1, pmc1, "no_interface"
-    nok( bool1, 'Comples !does no_interface' )
+    nok( bool1, 'Complex !does no_interface' )
 .end
 
 .sub instantiate__pasm__i
@@ -1156,6 +1157,17 @@
     todo( $I0, $S0 )
 .end
 
+.sub provides_complex
+    $P0 = new 'Complex'
+    $I0 = does $P0, 'complex'
+    ok($I0)
+
+    # ...And test a subclass, for good measure
+    $P0 = new 'MyComplex'
+    $I0 = does $P0, 'complex'
+    ok($I0)
+.end
+
 .namespace ['MyComplex']
 
 .sub 'init' :vtable


More information about the parrot-commits mailing list