r29991 - in /trunk/librose-object-perl: Changes MANIFEST META.yml debian/changelog lib/Rose/Object.pm lib/Rose/Object/MakeMethods.pm lib/Rose/Object/MakeMethods/Generic.pm lib/Rose/Object/MixIn.pm t/makemethods-xs.t t/makemethods.t

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Sat Jan 24 01:56:13 UTC 2009


Author: gregoa
Date: Sat Jan 24 01:56:10 2009
New Revision: 29991

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=29991
Log:
New upstream release.

Added:
    trunk/librose-object-perl/t/makemethods-xs.t
      - copied unchanged from r29990, branches/upstream/librose-object-perl/current/t/makemethods-xs.t
Modified:
    trunk/librose-object-perl/Changes
    trunk/librose-object-perl/MANIFEST
    trunk/librose-object-perl/META.yml
    trunk/librose-object-perl/debian/changelog
    trunk/librose-object-perl/lib/Rose/Object.pm
    trunk/librose-object-perl/lib/Rose/Object/MakeMethods.pm
    trunk/librose-object-perl/lib/Rose/Object/MakeMethods/Generic.pm
    trunk/librose-object-perl/lib/Rose/Object/MixIn.pm
    trunk/librose-object-perl/t/makemethods.t

Modified: trunk/librose-object-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-object-perl/Changes?rev=29991&op=diff
==============================================================================
--- trunk/librose-object-perl/Changes (original)
+++ trunk/librose-object-perl/Changes Sat Jan 24 01:56:10 2009
@@ -1,3 +1,7 @@
+0.855 (01.22.2009) - John Siracusa <siracusa at gmail.com>
+
+    * Added Class::XSAccessor support.
+
 0.854 (12.09.2008) - John Siracusa <siracusa at gmail.com>
 
     * Altered the default name for the adds_method and inherits_method

Modified: trunk/librose-object-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-object-perl/MANIFEST?rev=29991&op=diff
==============================================================================
--- trunk/librose-object-perl/MANIFEST (original)
+++ trunk/librose-object-perl/MANIFEST Sat Jan 24 01:56:10 2009
@@ -13,6 +13,7 @@
 t/lib/Person1.pm
 t/lib/Person2.pm
 t/makemethods.t
+t/makemethods-xs.t
 t/pod.t
 t/redefine.t
 META.yml                                 Module meta-data (added by MakeMaker)

Modified: trunk/librose-object-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-object-perl/META.yml?rev=29991&op=diff
==============================================================================
--- trunk/librose-object-perl/META.yml (original)
+++ trunk/librose-object-perl/META.yml Sat Jan 24 01:56:10 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Rose-Object
-version:            0.854
+version:            0.855
 abstract:           A simple object base class.
 author:
     - John Siracusa <siracusa at gmail.com>

Modified: trunk/librose-object-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-object-perl/debian/changelog?rev=29991&op=diff
==============================================================================
--- trunk/librose-object-perl/debian/changelog (original)
+++ trunk/librose-object-perl/debian/changelog Sat Jan 24 01:56:10 2009
@@ -1,3 +1,9 @@
+librose-object-perl (0.855-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregoa at debian.org>  Sat, 24 Jan 2009 02:54:42 +0100
+
 librose-object-perl (0.854-1) unstable; urgency=low
 
   [ gregor herrmann ]

Modified: trunk/librose-object-perl/lib/Rose/Object.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-object-perl/lib/Rose/Object.pm?rev=29991&op=diff
==============================================================================
--- trunk/librose-object-perl/lib/Rose/Object.pm (original)
+++ trunk/librose-object-perl/lib/Rose/Object.pm Sat Jan 24 01:56:10 2009
@@ -2,7 +2,7 @@
 
 use strict;
 
-our $VERSION = '0.854';
+our $VERSION = '0.855';
 
 sub new
 {

Modified: trunk/librose-object-perl/lib/Rose/Object/MakeMethods.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-object-perl/lib/Rose/Object/MakeMethods.pm?rev=29991&op=diff
==============================================================================
--- trunk/librose-object-perl/lib/Rose/Object/MakeMethods.pm (original)
+++ trunk/librose-object-perl/lib/Rose/Object/MakeMethods.pm Sat Jan 24 01:56:10 2009
@@ -7,6 +7,8 @@
 our $VERSION = '0.85';
 
 __PACKAGE__->allow_apparent_reload(1);
+
+our %Made_Method_Custom;
 
 sub import
 {
@@ -117,7 +119,7 @@
     METHOD: while(my($name, $code) = each(%$make))
     {
       Carp::croak "${class}::method_type(...) - key for $name is not a code ref!"
-        unless(ref $code eq 'CODE');
+        unless(ref $code eq 'CODE' || (ref $code eq 'HASH' && $code->{'make_method'}));
 
       if(my $code = $target_class->can($name))
       {
@@ -138,7 +140,18 @@
       }
 
       no warnings;
-      *{"${target_class}::$name"} = $code;
+
+      if(ref $code eq 'CODE')
+      {
+        *{"${target_class}::$name"} = $code;
+      }
+      else
+      {
+        # XXX: Must track these separately because they do not show up as
+        # XXX: being named __ANON__ when fetching the sub_identity()
+        $Made_Method_Custom{$target_class}{$name}++;
+        $code->{'make_method'}($name, $target_class, $options);
+      }
     }
   }
 
@@ -150,13 +163,14 @@
   my($class, $code) = @_;
   my($mm_class, $name) = $class->sub_identity($code);
   return 0  unless($class && $name);
-  return ($mm_class eq $class && $name eq '__ANON__') ? 1 : 0;
+  return (($mm_class eq $class && $name eq '__ANON__') ||
+          $Made_Method_Custom{$mm_class}{$name}) ? 1 : 0;
 }
 
 # Code from Sub::Identify
 sub sub_identity
 {
-  my($clas, $code) = @_;
+  my($class, $code) = @_;
 
   my @id;
 

Modified: trunk/librose-object-perl/lib/Rose/Object/MakeMethods/Generic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-object-perl/lib/Rose/Object/MakeMethods/Generic.pm?rev=29991&op=diff
==============================================================================
--- trunk/librose-object-perl/lib/Rose/Object/MakeMethods/Generic.pm (original)
+++ trunk/librose-object-perl/lib/Rose/Object/MakeMethods/Generic.pm Sat Jan 24 01:56:10 2009
@@ -4,10 +4,24 @@
 
 use Carp();
 
-our $VERSION = '0.853';
+our $VERSION = '0.855';
 
 use Rose::Object::MakeMethods;
 our @ISA = qw(Rose::Object::MakeMethods);
+
+eval
+{
+  require Class::XSAccessor;
+
+  unless($Class::XSAccessor::VERSION >= 0.14)
+  {
+    die "Class::XSAccessor $Class::XSAccessor::VERSION is too old";
+  }
+};
+
+our $Have_CXSA = $@ ? 0 : 1;
+
+our $Debug = 0;
 
 sub scalar
 {
@@ -32,10 +46,30 @@
   }
   elsif($interface eq 'get_set')
   {
-    $methods{$name} = sub
-    {
-      return $_[0]->{$key} = $_[1]  if(@_ > 1);
-      return $_[0]->{$key};
+    if($Have_CXSA && !$ENV{'ROSE_OBJECT_NO_CLASS_XSACCESOR'})
+    {
+      $methods{$name} = 
+      {
+        make_method => sub
+        {
+          my($name, $target_class, $options) = @_;
+
+          $Debug && warn "Class::XSAccessor make method ($name => $key) in $target_class\n";
+
+          Class::XSAccessor->import(
+            accessors => { $name => $key }, 
+            class     => $target_class,
+            replace   => $options->{'override_existing'} ? 1 : 0);
+        },
+      };
+    }
+    else
+    {
+      $methods{$name} = sub
+      {
+        return $_[0]->{$key} = $_[1]  if(@_ > 1);
+        return $_[0]->{$key};
+      }
     }
   }
   else { Carp::croak "Unknown interface: $interface" }
@@ -616,11 +650,7 @@
 
 =head1 DESCRIPTION
 
-L<Rose::Object::MakeMethods::Generic> is a method maker that inherits
-from L<Rose::Object::MakeMethods>.  See the L<Rose::Object::MakeMethods>
-documentation to learn about the interface.  The method types provided
-by this module are described below.  All methods work only with
-hash-based objects.
+L<Rose::Object::MakeMethods::Generic> is a method maker that inherits from L<Rose::Object::MakeMethods>.  See the L<Rose::Object::MakeMethods> documentation to learn about the interface.  The method types provided by this module are described below.  All methods work only with hash-based objects.
 
 =head1 METHODS TYPES
 
@@ -638,15 +668,11 @@
 
 =item C<hash_key>
 
-The key inside the hash-based object to use for the storage of this
-attribute. Defaults to the name of the method.
+The key inside the hash-based object to use for the storage of this attribute. Defaults to the name of the method.
 
 =item C<init_method>
 
-The name of the method to call when initializing the value of an
-undefined attribute.  This option is only applicable when using the
-C<get_set_init> interface.  Defaults to the method name with the prefix
-C<init_> added.
+The name of the method to call when initializing the value of an undefined attribute.  This option is only applicable when using the C<get_set_init> interface.  Defaults to the method name with the prefix C<init_> added.
 
 =item C<interface>
 
@@ -660,16 +686,11 @@
 
 =item C<get_set>
 
-Creates a simple get/set accessor method for an object attribute.  When
-called with an argument, the value of the attribute is set.  The current
-value of the attribute is returned.
-
-=item C<get_set_init> 
-
-Behaves like the C<get_set> interface unless the value of the attribute
-is undefined.  In that case, the method specified by the C<init_method>
-option is called and the attribute is set to the return value of that
-method.
+Creates a simple get/set accessor method for an object attribute.  When called with an argument, the value of the attribute is set.  The current value of the attribute is returned.
+
+=item C<get_set_init>
+
+Behaves like the C<get_set> interface unless the value of the attribute is undefined.  In that case, the method specified by the C<init_method> option is called and the attribute is set to the return value of that method.
 
 =back
 
@@ -694,10 +715,7 @@
 
 =item B<boolean>
 
-Create get/set methods for boolean attributes.  For each argument to
-these methods, the only thing that matters is whether it evaluates to
-true or false.  The return value is either, true, false (but defined),
-or undef if the value has never been set.
+Create get/set methods for boolean attributes.  For each argument to these methods, the only thing that matters is whether it evaluates to true or false.  The return value is either, true, false (but defined), or undef if the value has never been set.
 
 =over 4
 
@@ -707,21 +725,15 @@
 
 =item C<default>
 
-Determines the default value of the attribute.  This option is only
-applicable when using the C<get_set> interface.
+Determines the default value of the attribute.  This option is only applicable when using the C<get_set> interface.
 
 =item C<hash_key>
 
-The key inside the hash-based object to use for the storage of this
-attribute. Defaults to the name of the method.
+The key inside the hash-based object to use for the storage of this attribute. Defaults to the name of the method.
 
 =item C<init_method>
 
-The name of the method to call when initializing the value of an
-undefined attribute.  Again, the only thing that matters about the
-return value of this method is whether or not is is true or false.  This
-option is only applicable when using the C<get_set_init> interface. 
-Defaults to the method name with the prefix C<init_> added.
+The name of the method to call when initializing the value of an undefined attribute.  Again, the only thing that matters about the return value of this method is whether or not is is true or false.  This option is only applicable when using the C<get_set_init> interface. Defaults to the method name with the prefix C<init_> added.
 
 =item C<interface>
 
@@ -735,17 +747,13 @@
 
 =item C<get_set>
 
-Creates a simple get/set accessor method for a boolean object attribute.
-When called with an argument, the value of the attribute is set to true
-if the argument evaluates to true, false (but defined) otherwise.  The 
-current value of the attribute is returned.
-
-=item C<get_set_init> 
-
-Behaves like the C<get_set> interface unless the value of the attribute
-is undefined.  In that case, the method specified by the C<init_method>
-option is called and the attribute is set based on the boolean value of
-the return value of that method.
+Creates a simple get/set accessor method for a boolean object attribute. When called with an argument, the value of the attribute is set to true if the argument evaluates to true, false (but defined) otherwise.  The current value of the attribute is returned.
+
+If L<Class::XSAccessor> version 0.14 or later is installed and the C<ROSE_OBJECT_NO_CLASS_XSACCESOR> environment variable is not set to a true value, then L<Class::XSAccessor> will be used to generated the method.
+
+=item C<get_set_init>
+
+Behaves like the C<get_set> interface unless the value of the attribute is undefined.  In that case, the method specified by the C<init_method> option is called and the attribute is set based on the boolean value of the return value of that method.
 
 =back
 
@@ -792,15 +800,11 @@
 
 =item C<hash_key>
 
-The key inside the hash-based object to use for the storage of this
-attribute.  Defaults to the name of the method.
+The key inside the hash-based object to use for the storage of this attribute.  Defaults to the name of the method.
 
 =item C<init_method>
 
-The name of the method to call when initializing the value of an
-undefined hash attribute.    This method should return a reference to a
-hash, and is only applicable when using the C<get_set_init> interface.
-Defaults to the method name with the prefix C<init_> added.
+The name of the method to call when initializing the value of an undefined hash attribute.    This method should return a reference to a hash, and is only applicable when using the C<get_set_init> interface. Defaults to the method name with the prefix C<init_> added.
 
 =item C<interface>
 
@@ -814,96 +818,65 @@
 
 =item C<get_set>
 
-If called with no arguments, returns a list of key/value pairs in
-list context or a reference to the actual hash stored by the object
-in scalar context.
-
-If called with one argument, and that argument is a reference to a hash,
-that hash reference is used as the new value for the attribute.  Returns
-a list of key/value pairs in list context or a reference to the actual
-hash stored by the object in scalar context.
-
-If called with one argument, and that argument is a reference to an array,
-then a list of the hash values for each key in the array is returned.
-
-If called with one argument, and it is not a reference to a hash or an array,
-then the hash value for that key is returned.
-
-If called with an even number of arguments, they are taken as name/value
-pairs and are added to the hash.  It then returns a list of key/value
-pairs in list context or a reference to the actual hash stored by the
-object in scalar context.
+If called with no arguments, returns a list of key/value pairs in list context or a reference to the actual hash stored by the object in scalar context.
+
+If called with one argument, and that argument is a reference to a hash, that hash reference is used as the new value for the attribute.  Returns a list of key/value pairs in list context or a reference to the actual hash stored by the object in scalar context.
+
+If called with one argument, and that argument is a reference to an array, then a list of the hash values for each key in the array is returned.
+
+If called with one argument, and it is not a reference to a hash or an array, then the hash value for that key is returned.
+
+If called with an even number of arguments, they are taken as name/value pairs and are added to the hash.  It then returns a list of key/value pairs in list context or a reference to the actual hash stored by the object in scalar context.
 
 Passing an odd number of arguments greater than 1 causes a fatal error.
 
-=item C<get_set_init> 
-
-Behaves like the C<get_set> interface unless the attribute is undefined.
-In that case, the method specified by the C<init_method> option is
-called and the attribute is set to the return value of that method,
-which should be a reference to a hash.
-
-=item C<get_set_inited> 
-
-Behaves like the C<get_set> interface unless the attribute is undefined.
-In that case, it is initialized to an empty hash before proceeding as
-usual.
-
-=item C<get_set_all> 
-
-If called with no arguments, returns a list of key/value pairs in
-list context or a reference to the actual hash stored by the object
-in scalar context.
-
-If called with one argument, and that argument is a reference to a hash,
-that hash reference is used as the new value for the attribute.  Returns
-a list of key/value pairs in list context or a reference to the actual
-hash stored by the object in scalar context.
-
-Otherwise, the hash is emptied and the arguments are taken as name/value
-pairs that are then added to the hash.  It then returns a list of
-key/value pairs in list context or a reference to the actual hash stored
-by the object in scalar context.
-
-=item C<get_set_init_all> 
-
-Behaves like the C<get_set_all> interface unless the attribute is undefined.
-In that case, the method specified by the C<init_method> option is
-called and the attribute is set to the return value of that method,
-which should be a reference to a hash.
-
-=item C<clear> 
+=item C<get_set_init>
+
+Behaves like the C<get_set> interface unless the attribute is undefined. In that case, the method specified by the C<init_method> option is called and the attribute is set to the return value of that method, which should be a reference to a hash.
+
+=item C<get_set_inited>
+
+Behaves like the C<get_set> interface unless the attribute is undefined. In that case, it is initialized to an empty hash before proceeding as usual.
+
+=item C<get_set_all>
+
+If called with no arguments, returns a list of key/value pairs in list context or a reference to the actual hash stored by the object in scalar context.
+
+If called with one argument, and that argument is a reference to a hash, that hash reference is used as the new value for the attribute.  Returns a list of key/value pairs in list context or a reference to the actual hash stored by the object in scalar context.
+
+Otherwise, the hash is emptied and the arguments are taken as name/value pairs that are then added to the hash.  It then returns a list of key/value pairs in list context or a reference to the actual hash stored by the object in scalar context.
+
+=item C<get_set_init_all>
+
+Behaves like the C<get_set_all> interface unless the attribute is undefined. In that case, the method specified by the C<init_method> option is called and the attribute is set to the return value of that method, which should be a reference to a hash.
+
+=item C<clear>
 
 Sets the attribute to an empty hash.
 
-=item C<reset> 
+=item C<reset>
 
 Sets the attribute to undef.
 
-=item C<delete> 
-
-Deletes the key(s) passed as arguments.  Failure to pass any arguments
-causes a fatal error.
-
-=item C<exists> 
-
-Returns true of the argument exists in the hash, false otherwise.
-Failure to pass an argument or passing more than one argument causes a
-fatal error.
-
-=item C<keys> 
-
-Returns the keys of the hash in list context, or a reference to an array
-of the keys of the hash in scalar context.  The keys are not sorted.
-
-=item C<names> 
+=item C<delete>
+
+Deletes the key(s) passed as arguments.  Failure to pass any arguments causes a fatal error.
+
+=item C<exists>
+
+Returns true of the argument exists in the hash, false otherwise. Failure to pass an argument or passing more than one argument causes a fatal error.
+
+=item C<keys>
+
+Returns the keys of the hash in list context, or a reference to an array of the keys of the hash in scalar context.  The keys are not sorted.
+
+=item C<names>
 
 An alias for the C<keys> interface.
 
-=item C<values> 
-
-Returns the values of the hash in list context, or a reference to an array
-of the values of the hash in scalar context.  The values are not sorted.
+=item C<values>
+
+Returns the values of the hash in list context, or a reference to an array of the values of the hash in scalar context.  The values are not sorted.
 
 =back
 
@@ -970,16 +943,11 @@
 
 =item C<hash_key>
 
-The key inside the hash-based object to use for the storage of this
-attribute.  Defaults to the name of the method.
+The key inside the hash-based object to use for the storage of this attribute.  Defaults to the name of the method.
 
 =item C<init_method>
 
-The name of the method to call when initializing the value of an undefined
-array attribute.    This method should return a reference to an array.  This
-option is only applicable when using the C<get_set_init>, C<push>, and C<add>
-interfaces.  When using the C<get_set_init> interface, C<init_method> defaults
-to the method name with the prefix C<init_> added.
+The name of the method to call when initializing the value of an undefined array attribute.    This method should return a reference to an array.  This option is only applicable when using the C<get_set_init>, C<push>, and C<add> interfaces.  When using the C<get_set_init> interface, C<init_method> defaults to the method name with the prefix C<init_> added.
 
 =item C<interface>
 
@@ -993,48 +961,31 @@
 
 =item C<get_set>
 
-If called with no arguments, returns the array contents in list context
-or a reference to the actual array stored by the object in scalar
-context.
-
-If called with one argument, and that argument is a reference to an
-array, that array reference is used as the new value for the attribute. 
-Returns the array contents in list context or a reference to the actual
-array stored by the object in scalar context.
-
-If called with one argument, and that argument is not a reference to an
-array, or if called with more than one argument, then the array contents
-are replaced by the arguments.  Returns the array contents in list
-context or a reference to the actual array stored by the object in
-scalar context.
-
-=item C<get_set_init> 
-
-Behaves like the C<get_set> interface unless the attribute is undefined.
-In that case, the method specified by the C<init_method> option is
-called and the attribute is set to the return value of that method,
-which should be a reference to an array.
-
-=item C<get_set_inited> 
-
-Behaves like the C<get_set> interface unless the attribute is undefined.
-In that case, it is initialized to an empty array before proceeding as
-usual.
-
-=item C<get_set_item> 
+If called with no arguments, returns the array contents in list context or a reference to the actual array stored by the object in scalar context.
+
+If called with one argument, and that argument is a reference to an array, that array reference is used as the new value for the attribute. Returns the array contents in list context or a reference to the actual array stored by the object in scalar context.
+
+If called with one argument, and that argument is not a reference to an array, or if called with more than one argument, then the array contents are replaced by the arguments.  Returns the array contents in list context or a reference to the actual array stored by the object in scalar context.
+
+=item C<get_set_init>
+
+Behaves like the C<get_set> interface unless the attribute is undefined. In that case, the method specified by the C<init_method> option is called and the attribute is set to the return value of that method, which should be a reference to an array.
+
+=item C<get_set_inited>
+
+Behaves like the C<get_set> interface unless the attribute is undefined. In that case, it is initialized to an empty array before proceeding as usual.
+
+=item C<get_set_item>
 
 If called with one argument, returns the item at that array index.
 
-If called with two arguments, sets the item at the array index specified
-by the first argument to the value specified by the second argument.
+If called with two arguments, sets the item at the array index specified by the first argument to the value specified by the second argument.
 
 Failure to pass any arguments causes a fatal error.
 
 =item C<exists>
 
-Returns true of the argument exists in the hash, false otherwise.
-Failure to pass an argument or passing more than one argument causes a
-fatal error.
+Returns true of the argument exists in the hash, false otherwise. Failure to pass an argument or passing more than one argument causes a fatal error.
 
 =item C<add>
 
@@ -1042,33 +993,25 @@
 
 =item C<push>
 
-If called with a list or a reference to an array, the contents of the list or
-referenced array are added to the end of the array.  If called with no
-arguments, a fatal error will occur.
+If called with a list or a reference to an array, the contents of the list or referenced array are added to the end of the array.  If called with no arguments, a fatal error will occur.
 
 =item C<pop>
 
-Remove an item from the end of the array and returns it.  If an integer
-argument is passed, then that number of items is removed and returned. 
-Otherwise, just one is removed and returned.
+Remove an item from the end of the array and returns it.  If an integer argument is passed, then that number of items is removed and returned. Otherwise, just one is removed and returned.
 
 =item C<shift>
 
-Remove an item from the start of the array and returns it.  If an integer
-argument is passed, then that number of items is removed and returned. 
-Otherwise, just one is removed and returned.
+Remove an item from the start of the array and returns it.  If an integer argument is passed, then that number of items is removed and returned. Otherwise, just one is removed and returned.
 
 =item C<unshift>
 
-If called with a list or a reference to an array, the contents of the list or
-referenced array are added to the start of the array.  If called with no
-arguments, a fatal error will occur.
-
-=item C<clear> 
+If called with a list or a reference to an array, the contents of the list or referenced array are added to the start of the array.  If called with no arguments, a fatal error will occur.
+
+=item C<clear>
 
 Sets the attribute to an empty array.
 
-=item C<reset> 
+=item C<reset>
 
 Sets the attribute to undef.
 

Modified: trunk/librose-object-perl/lib/Rose/Object/MixIn.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-object-perl/lib/Rose/Object/MixIn.pm?rev=29991&op=diff
==============================================================================
--- trunk/librose-object-perl/lib/Rose/Object/MixIn.pm (original)
+++ trunk/librose-object-perl/lib/Rose/Object/MixIn.pm Sat Jan 24 01:56:10 2009
@@ -306,6 +306,6 @@
 
 =head1 LICENSE
 
-Copyright (c) 2008 by John C. Siracusa.  All rights reserved.  This program is
+Copyright (c) 2009 by John C. Siracusa.  All rights reserved.  This program is
 free software; you can redistribute it and/or modify it under the same terms
 as Perl itself.

Modified: trunk/librose-object-perl/t/makemethods.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/librose-object-perl/t/makemethods.t?rev=29991&op=diff
==============================================================================
--- trunk/librose-object-perl/t/makemethods.t (original)
+++ trunk/librose-object-perl/t/makemethods.t Sat Jan 24 01:56:10 2009
@@ -2,10 +2,17 @@
 
 use strict;
 
-use Test::More tests => 627;
+use Test::More tests => 629;
 
 BEGIN
 {
+  # Don't use Class::XSAccessor unless invoked from t/makemethods-xs.t
+  # as indicated by magic (false) value 0, set in t/makemethods-xs.t
+  unless(defined $ENV{'ROSE_OBJECT_NO_CLASS_XSACCESOR'})
+  {
+    $ENV{'ROSE_OBJECT_NO_CLASS_XSACCESOR'} = 1;
+  }
+
   use_ok('Rose::Object');
   use_ok('Rose::Object::MakeMethods::Generic');
   use_ok('Rose::Class');
@@ -24,8 +31,9 @@
 # scalar
 #
 
-$p->bar('bar');
-is($p->bar, 'bar', 'Set named attribute (scalar)');
+is($p->bar, undef, 'Get named attribute (scalar)');
+is($p->bar('bar'), 'bar', 'Set named attribute 1 (scalar)');
+is($p->bar, 'bar', 'Set named attribute 2 (scalar)');
 
 #
 # scalar --get_set_init




More information about the Pkg-perl-cvs-commits mailing list