Fix for 1073532: Mo doesn't work with Scalar::Util::PP

Unlike Scalar::Util, Scalar::Util::PP::looks_like_number shifts @_,
so calling it as &looks_like_number works differently in both
versions; see https://rt.cpan.org/Public/Bug/Display.html?id=80525
This commit is contained in:
Brian Fraser fraserb@gmail.com
2012-10-31 12:04:30 -03:00
parent 64fe380986
commit e6158cd2f8
3 changed files with 51 additions and 7 deletions

28
t/lib/Mo/isa_subtest.pm Normal file
View File

@@ -0,0 +1,28 @@
BEGIN {
require Scalar::Util::PP;
*Scalar::Util:: = \*Scalar::Util::PP::;
$INC{"Scalar/Util.pm"} = __FILE__;
};
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
};
use strict;
use warnings;
{
package isa_subtest;
use Mo;
has attr => (
is => 'rw',
isa => 'Int',
);
1;
}
isa_subtest->new(attr => 100);