Subject: | Use strict test does not recognise use Moose |
The tests for use strict and use warnings do not recognise use Moose and
use Moose::Role as being equivalent. Attached a patch to fix this
Subject: | uses.patch |
--- Uses.pm 2008-08-26 10:31:04.000000000 +0100
+++ Uses.pm 2008-08-26 10:37:57.000000000 +0100
@@ -81,11 +81,15 @@
my ($strict)=$uses->{'strict'};
my ($moose)=$uses->{'Moose'};
- return 0 unless $strict;
+ my ($moose_role)=$uses->{'Moose::Role'};
+ return 0 unless $strict or $moose or $moose_role;
my $total = $strict->{in_code};
if ($moose) {
$total += $moose->{in_code};
}
+ if ($moose_role) {
+ $total += $moose_role->{in_code};
+ }
return 1 if $total >= @$modules;
return 0;
},
@@ -101,8 +105,17 @@
my $uses=$d->{uses};
return 0 unless $modules && $uses;
my ($warnings)=$uses->{'warnings'};
- return 0 unless $warnings;
- return 1 if $warnings->{in_code} >= @$modules;
+ my ($moose)=$uses->{'Moose'};
+ my ($moose_role)=$uses->{'Moose::Role'};
+ return 0 unless $warnings or $moose or $moose_role;
+ my $total = $warnings->{in_code};
+ if ($moose) {
+ $total += $moose->{in_code};
+ }
+ if ($moose_role) {
+ $total += $moose_role->{in_code};
+ }
+ return 1 if $total >= @$modules;
return 0;
},
},