diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2011-01-08 23:09:04 +0000 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2011-01-08 23:09:04 +0000 |
commit | 0019012ad86d597fb507f71577d70ecd4c416bba (patch) | |
tree | 04fc542107733593ff7160bb07de38880c7917a7 | |
parent | 4fc94532da4b3d2462eb7388c63cc5a714c95725 (diff) | |
download | perl-0019012ad86d597fb507f71577d70ecd4c416bba.tar.gz |
Update Object-Accessor to CPAN version 0.38
[DELTA]
Changes for 0.38 Fri Jan 7 21:47:51 GMT 2011
=================================================
* Apply blead patch from Peter Acklam
-rwxr-xr-x | Porting/Maintainers.pl | 2 | ||||
-rw-r--r-- | cpan/Object-Accessor/lib/Object/Accessor.pm | 2 | ||||
-rw-r--r-- | cpan/Object-Accessor/t/06_Object-Accessor-alias.t | 63 | ||||
-rw-r--r-- | pod/perldelta.pod | 4 |
4 files changed, 49 insertions, 22 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 30144ad140..40b7a2e1e4 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -1083,7 +1083,7 @@ use File::Glob qw(:case); 'Object::Accessor' => { 'MAINTAINER' => 'kane', - 'DISTRIBUTION' => 'BINGOS/Object-Accessor-0.36.tar.gz', + 'DISTRIBUTION' => 'BINGOS/Object-Accessor-0.38.tar.gz', 'FILES' => q[cpan/Object-Accessor], 'UPSTREAM' => 'cpan', }, diff --git a/cpan/Object-Accessor/lib/Object/Accessor.pm b/cpan/Object-Accessor/lib/Object/Accessor.pm index c943ee078e..c7933ec866 100644 --- a/cpan/Object-Accessor/lib/Object/Accessor.pm +++ b/cpan/Object-Accessor/lib/Object/Accessor.pm @@ -10,7 +10,7 @@ use Data::Dumper; ### disable string overloading for callbacks require overload; -$VERSION = '0.36'; +$VERSION = '0.38'; $FATAL = 0; $DEBUG = 0; diff --git a/cpan/Object-Accessor/t/06_Object-Accessor-alias.t b/cpan/Object-Accessor/t/06_Object-Accessor-alias.t index 2a8aa81f0d..f302a09523 100644 --- a/cpan/Object-Accessor/t/06_Object-Accessor-alias.t +++ b/cpan/Object-Accessor/t/06_Object-Accessor-alias.t @@ -9,25 +9,48 @@ my $Class = 'Object::Accessor'; use_ok($Class); -my $Object = $Class->new; -my $Acc = 'foo'; -my $Alias = 'bar'; - -### basic sanity test -{ ok( $Object, "Object created" ); - - ok( $Object->mk_accessors( $Acc ), - " Accessor ->$Acc created" ); - ok( $Object->$Acc( $$ ), " ->$Acc set to $$" ); +my $Object = $Class->new; +my $Acc = 'foo'; +my $Alias = 'bar'; + +ok( $Object, "Object created" ); +isa_ok( $Object, $Class, " Object" ); + +### add an accessor +{ my $rv = $Object->mk_accessors( $Acc ); + ok( $rv, "Created accessor '$Acc'" ); + ok( $Object->$Acc( $$ )," Set value" ); + is( $Object->$Acc, $$, " Retrieved value" ); +} + +### add an alias +{ my $rv = $Object->mk_aliases( $Alias => $Acc ); + ok( $rv, "Created alias '$Alias'" ); + ok( $Object->can( $Alias ), + " Alias '$Alias' exists" ); + is( $Object->$Alias, $Object->$Acc, + " Alias & original return the same value" ); + + ok( $Object->$Alias( $$.$$ ), + " Changed value using alias" ); + is( $Object->$Alias, $Object->$Acc, + " Alias & original return the same value" ); +} + +### test if cloning works +{ my $clone = $Object->mk_clone; + ok( $clone, "Cloned object" ); + + is_deeply( [sort $clone->ls_accessors], [sort $Object->ls_accessors], + " All accessors cloned" ); + + ok( $clone->$Acc( $$ ), " Set value" ); + is( $clone->$Alias, $clone->$Acc, + " Alias & original return the same value" ); + + ok( $clone->$Alias( $$.$$ ), + " Changed value using alias" ); + is( $clone->$Alias, $clone->$Acc, + " Alias & original return the same value" ); } -### alias tests -{ ok( $Object->mk_aliases( $Alias => $Acc ), - "Alias ->$Alias => ->$Acc" ); - ok( $Object->$Alias, " ->$Alias returns value" ); - is( $Object->$Acc, $Object->$Alias, - " ->$Alias eq ->$Acc" ); - ok( $Object->$Alias( $0 ), " Set value via alias ->$Alias" ); - is( $Object->$Acc, $Object->$Alias, - " ->$Alias eq ->$Acc" ); -} diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 74a632190f..4bed524e64 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -148,6 +148,10 @@ C<Module::Load::Conditional> has been upgraded from 0.38 to 0.40 =item * +C<Object::Accessor> has been upgraded from 0.36 to 0.38 + +=item * + C<threads> has been upgraded from version 1.81_03 to 1.82 =item * |