Skip to content

Commit

Permalink
stringify version before comparing, as recommended by Zefram
Browse files Browse the repository at this point in the history
  • Loading branch information
karenetheridge committed Jul 11, 2016
1 parent 67ddc35 commit 3c2611d
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/Class/MOP.pm
Expand Up @@ -20,7 +20,7 @@ use Class::MOP::Attribute;
use Class::MOP::Method;

BEGIN {
*IS_RUNNING_ON_5_10 = ($] < 5.009_005)
*IS_RUNNING_ON_5_10 = ("$]" < 5.009_005)
? sub () { 0 }
: sub () { 1 };

Expand Down
4 changes: 2 additions & 2 deletions lib/Class/MOP/Mixin/HasOverloads.pm
Expand Up @@ -47,7 +47,7 @@ sub get_overloaded_operator {
return $self->_overload_map->{$op} ||= $self->_overload_for($op);
}

use constant _SET_FALLBACK_EACH_TIME => $] < 5.120;
use constant _SET_FALLBACK_EACH_TIME => "$]" < 5.120;

sub add_overloaded_operator {
my $self = shift;
Expand Down Expand Up @@ -103,7 +103,7 @@ sub remove_overloaded_operator {
# overload.pm provides no api for this - but the problem that makes this
# necessary has been fixed in 5.18
$self->get_or_add_package_symbol('%OVERLOAD')->{dummy}++
if $] < 5.017000;
if "$]" < 5.017000;

$self->remove_package_symbol('&(' . $op);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Moose/Meta/Role/Application/ToInstance.pm
Expand Up @@ -17,7 +17,7 @@ __PACKAGE__->meta->add_attribute('rebless_params' => (
Class::MOP::_definition_context(),
));

use constant _NEED_OVERLOAD_HACK_FOR_OBJECTS => $] < 5.008009;
use constant _NEED_OVERLOAD_HACK_FOR_OBJECTS => "$]" < 5.008009;

sub apply {
my ( $self, $role, $object, $args ) = @_;
Expand Down
2 changes: 1 addition & 1 deletion t/cmop/Class_C3_compatibility.t
Expand Up @@ -56,7 +56,7 @@ ok(Diamond_C->meta->has_method('hello'), '... C has a method hello');
ok(!Diamond_D->meta->has_method('hello'), '... D does not have a method hello');

SKIP: {
skip "C3 does not make aliases on 5.9.5+", 2 if $] > 5.009_004;
skip "C3 does not make aliases on 5.9.5+", 2 if "$]" > 5.009_004;
ok(defined &Diamond_B::hello, '... B does have an alias to the method hello');
ok(defined &Diamond_D::hello, '... D does have an alias to the method hello');
}
Expand Down
2 changes: 1 addition & 1 deletion t/cmop/anon_class_leak.t
Expand Up @@ -11,7 +11,7 @@ BEGIN {
use Class::MOP;

# 5.10.0 has a bug on weaken($hash_ref) which leaks an AV.
my $expected = ( $] == 5.010_000 ? 1 : 0 );
my $expected = ( "$]" == 5.010_000 ? 1 : 0 );

leaks_cmp_ok {
Class::MOP::Class->create_anon_class();
Expand Down
2 changes: 1 addition & 1 deletion t/cmop/get_code_info.t
Expand Up @@ -37,7 +37,7 @@ code_name_is( \&Class::MOP::Method::name, "Class::MOP::Method", "name" );
my ($class, $code) = @_;
my @info = Class::MOP::get_code_info($code);

if ( $] >= 5.011 ) {
if ( "$]" >= 5.011 ) {
::is_deeply(\@info, ['Foo', 'foo'], "got a name for a code ref in an attr handler");
}
else {
Expand Down
2 changes: 1 addition & 1 deletion t/cmop/methods.t
Expand Up @@ -199,7 +199,7 @@ is_deeply(
);

my @universal_methods = qw/isa can VERSION/;
push @universal_methods, 'DOES' if $] >= 5.010;
push @universal_methods, 'DOES' if "$]" >= 5.010;

is_deeply(
[
Expand Down
2 changes: 1 addition & 1 deletion t/cmop/universal_methods.t
Expand Up @@ -10,7 +10,7 @@ my %methods = map { $_->name => 1 } $meta_class->get_all_methods();
my %method_names = map { $_ => 1 } $meta_class->get_all_method_names();

my @universal_methods = qw/isa can VERSION/;
push @universal_methods, 'DOES' if $] >= 5.010;
push @universal_methods, 'DOES' if "$]" >= 5.010;

for my $method (@universal_methods) {
ok(
Expand Down
2 changes: 1 addition & 1 deletion t/type_constraints/with-specio.t
Expand Up @@ -7,7 +7,7 @@ use Test::More;

BEGIN {
plan skip_all => 'These tests requires Specio, which requires perl 5.010'
unless $] >= 5.010;
unless "$]" >= 5.010;
}

use Test::Requires {
Expand Down
4 changes: 2 additions & 2 deletions xt/author/memory_leaks.t
Expand Up @@ -4,7 +4,7 @@ use warnings;
use Test::More;
BEGIN {
plan skip_all => 'Leak tests fail under perl 5.21.[6-9]'
if $] >= '5.021006' and $] <= '5.021011';
if "$]" >= '5.021006' and "$]" <= '5.021011';
plan skip_all => 'Leak tests fail under Devel::Cover' if $INC{'Devel/Cover.pm'};
}

Expand Down Expand Up @@ -76,7 +76,7 @@ use Moose::Util::TypeConstraints;


{
local $TODO = 'anonymous classes leak on 5.8' if $] < 5.010;
local $TODO = 'anonymous classes leak on 5.8' if "$]" < 5.010;
no_leaks_ok(
sub {
Moose::Meta::Class->create_anon_class->new_object;
Expand Down

0 comments on commit 3c2611d

Please sign in to comment.