From: Peter Rabbitson Date: Thu, 16 Dec 2010 09:28:47 +0000 (+0000) Subject: Plant a better diagnostic for when the xs shim cached detection fails X-Git-Tag: v0.10002~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FClass-Accessor-Grouped.git;a=commitdiff_plain;h=21498f4a6072fa2cd85f7840c7855f434b8919f5 Plant a better diagnostic for when the xs shim cached detection fails --- diff --git a/lib/Class/Accessor/Grouped.pm b/lib/Class/Accessor/Grouped.pm index 8925c8e..3317c16 100644 --- a/lib/Class/Accessor/Grouped.pm +++ b/lib/Class/Accessor/Grouped.pm @@ -546,7 +546,7 @@ BEGIN { *__CAG_TRACK_UNDEFER_FAIL = ( $INC{'Test/Builder.pm'} || $INC{'Test/Builder2.pm'} and - $0 =~ m|^ x?t [\/\\] .+ \.t $|x + $0 =~ m|^ x?t / .+ \.t $|x ) ? sub () { 1 } : sub () { 0 } ; diff --git a/t/accessors_xs_cachedwarn.t b/t/accessors_xs_cachedwarn.t index 14149c5..7b9dfaf 100644 --- a/t/accessors_xs_cachedwarn.t +++ b/t/accessors_xs_cachedwarn.t @@ -1,8 +1,5 @@ use strict; use warnings; -use FindBin qw($Bin); -use File::Spec::Functions; -use File::Spec::Unix (); # need this for %INC munging use Test::More; use lib 't/lib'; @@ -42,6 +39,9 @@ is ( scalar (grep { $_ =~ /^\QDeferred version of method AccessorGroups::singlefield invoked more than once/ } @w), 3, '3 warnings produced as expected on cached invocation during testing', -); +) or do { + require Data::Dumper; + diag "\n \$0 is: " . Data::Dumper->new([$0])->Useqq(1)->Terse(1)->Dump; +}; done_testing;