[Bast-commits] r9635 - in Class-Accessor-Grouped/trunk:
lib/Class/Accessor t t/lib
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Mon Jul 12 23:21:40 GMT 2010
Author: caelum
Date: 2010-07-13 00:21:40 +0100 (Tue, 13 Jul 2010)
New Revision: 9635
Modified:
Class-Accessor-Grouped/trunk/lib/Class/Accessor/Grouped.pm
Class-Accessor-Grouped/trunk/t/accessors.t
Class-Accessor-Grouped/trunk/t/accessors_ro.t
Class-Accessor-Grouped/trunk/t/accessors_wo.t
Class-Accessor-Grouped/trunk/t/accessors_xs.t
Class-Accessor-Grouped/trunk/t/lib/AccessorGroups.pm
Class-Accessor-Grouped/trunk/t/lib/AccessorGroupsRO.pm
Log:
add failing tests for punctuation in $field, remove unnecessary Win32 check and update POD
Modified: Class-Accessor-Grouped/trunk/lib/Class/Accessor/Grouped.pm
===================================================================
--- Class-Accessor-Grouped/trunk/lib/Class/Accessor/Grouped.pm 2010-07-12 11:12:52 UTC (rev 9634)
+++ Class-Accessor-Grouped/trunk/lib/Class/Accessor/Grouped.pm 2010-07-12 23:21:40 UTC (rev 9635)
@@ -10,22 +10,16 @@
our $VERSION = '0.09003';
$VERSION = eval $VERSION;
-# Class::XSAccessor is segfaulting on win32, so be careful
-# Win32 users can set $hasXS to try to use it anyway
-
our $hasXS;
sub _hasXS {
-
if (not defined $hasXS) {
$hasXS = 0;
- if ($^O ne 'MSWin32') {
- eval {
- require Class::XSAccessor;
- $hasXS = 1;
- };
- }
+ eval {
+ require Class::XSAccessor;
+ $hasXS = 1;
+ };
}
return $hasXS;
@@ -467,20 +461,16 @@
=head1 PERFORMANCE
You can speed up accessors of type 'simple' by installing L<Class::XSAccessor>.
-Note however that the use of this module is disabled by default on Win32
-systems, as it causes yet unresolved segfaults. If you are a Win32 user, and
-want to try this module with L<Class::XSAccessor>, set
-C<$Class::Accessor::Grouped::hasXS> to a true value B<before> registering
-your accessors (e.g. in a C<BEGIN> block)
=head1 AUTHORS
Matt S. Trout <mst at shadowcatsystems.co.uk>
Christopher H. Laco <claco at chrislaco.com>
-With contributions from:
+=head1 CONTRIBUTORS
-Guillermo Roditi <groditi at cpan.org>
+groditi: Guillermo Roditi <groditi at cpan.org>
+ribasushi: Peter Rabbitson <ribasushi at cpan.org>
=head1 COPYRIGHT & LICENSE
Modified: Class-Accessor-Grouped/trunk/t/accessors.t
===================================================================
--- Class-Accessor-Grouped/trunk/t/accessors.t 2010-07-12 11:12:52 UTC (rev 9634)
+++ Class-Accessor-Grouped/trunk/t/accessors.t 2010-07-12 23:21:40 UTC (rev 9635)
@@ -72,8 +72,9 @@
foreach (qw/lr1 lr2/) {
my $name = "$_".'name';
my $alias = "_${name}_accessor";
- my $field = "$_".'field';
+ my $field = { lr1 => 'lr1;field', lr2 => q{lr2'field} }->{$_};
+
can_ok($class, $name, $alias);
ok(!$class->can($field));
@@ -98,4 +99,3 @@
};
1;
-
Modified: Class-Accessor-Grouped/trunk/t/accessors_ro.t
===================================================================
--- Class-Accessor-Grouped/trunk/t/accessors_ro.t 2010-07-12 11:12:52 UTC (rev 9634)
+++ Class-Accessor-Grouped/trunk/t/accessors_ro.t 2010-07-12 23:21:40 UTC (rev 9635)
@@ -59,7 +59,7 @@
foreach (qw/lr1 lr2/) {
my $name = "$_".'name';
my $alias = "_${name}_accessor";
- my $field = "$_".'field';
+ my $field = { lr1 => 'lr1;field', lr2 => q{lr2'field} }->{$_};
can_ok($class, $name, $alias);
ok(!$class->can($field));
Modified: Class-Accessor-Grouped/trunk/t/accessors_wo.t
===================================================================
--- Class-Accessor-Grouped/trunk/t/accessors_wo.t 2010-07-12 11:12:52 UTC (rev 9634)
+++ Class-Accessor-Grouped/trunk/t/accessors_wo.t 2010-07-12 23:21:40 UTC (rev 9635)
@@ -53,8 +53,9 @@
foreach (qw/lr1 lr2/) {
my $name = "$_".'name';
my $alias = "_${name}_accessor";
- my $field = "$_".'field';
+ my $field = { lr1 => 'lr1;field', lr2 => q{lr2'field} }->{$_};
+
can_ok($class, $name, $alias);
ok(!$class->can($field));
Modified: Class-Accessor-Grouped/trunk/t/accessors_xs.t
===================================================================
--- Class-Accessor-Grouped/trunk/t/accessors_xs.t 2010-07-12 11:12:52 UTC (rev 9634)
+++ Class-Accessor-Grouped/trunk/t/accessors_xs.t 2010-07-12 23:21:40 UTC (rev 9635)
@@ -5,14 +5,9 @@
use Test::More;
use lib 't/lib';
-BEGIN {
- # Enable XSAccessor check
- $Class::Accessor::Grouped::hasXS = undef;
-
- require AccessorGroups;
-}
+use AccessorGroups ();
plan skip_all => 'Class::XSAccessor not available'
unless Class::Accessor::Grouped::_hasXS();
-require( catfile($Bin, 'accessors.t') );
\ No newline at end of file
+require( catfile($Bin, 'accessors.t') );
Modified: Class-Accessor-Grouped/trunk/t/lib/AccessorGroups.pm
===================================================================
--- Class-Accessor-Grouped/trunk/t/lib/AccessorGroups.pm 2010-07-12 11:12:52 UTC (rev 9634)
+++ Class-Accessor-Grouped/trunk/t/lib/AccessorGroups.pm 2010-07-12 23:21:40 UTC (rev 9635)
@@ -5,7 +5,7 @@
__PACKAGE__->mk_group_accessors('simple', 'singlefield');
__PACKAGE__->mk_group_accessors('simple', qw/multiple1 multiple2/);
-__PACKAGE__->mk_group_accessors('simple', [qw/lr1name lr1field/], [qw/lr2name lr2field/]);
+__PACKAGE__->mk_group_accessors('simple', [qw/lr1name lr1;field/], [qw/lr2name lr2'field/]);
__PACKAGE__->mk_group_accessors('component_class', 'result_class');
sub new {
Modified: Class-Accessor-Grouped/trunk/t/lib/AccessorGroupsRO.pm
===================================================================
--- Class-Accessor-Grouped/trunk/t/lib/AccessorGroupsRO.pm 2010-07-12 11:12:52 UTC (rev 9634)
+++ Class-Accessor-Grouped/trunk/t/lib/AccessorGroupsRO.pm 2010-07-12 23:21:40 UTC (rev 9635)
@@ -5,7 +5,7 @@
__PACKAGE__->mk_group_ro_accessors('single', 'singlefield');
__PACKAGE__->mk_group_ro_accessors('multiple', qw/multiple1 multiple2/);
-__PACKAGE__->mk_group_ro_accessors('listref', [qw/lr1name lr1field/], [qw/lr2name lr2field/]);
+__PACKAGE__->mk_group_ro_accessors('listref', [qw/lr1name lr1;field/], [qw/lr2name lr2'field/]);
sub new {
return bless {}, shift;
More information about the Bast-commits
mailing list