From: Graham Knop Date: Fri, 22 Sep 2017 10:38:16 +0000 (+0200) Subject: clean up module hiding in tests X-Git-Tag: v1.003010~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7c484eb954f122d0afee6979eb561a47eb3e5907;p=p5sagit%2FJSON-MaybeXS.git clean up module hiding in tests --- diff --git a/t/legacy.t b/t/legacy.t index 1df4790..0fe9e40 100644 --- a/t/legacy.t +++ b/t/legacy.t @@ -3,8 +3,8 @@ use warnings; # hide Cpanel::JSON::XS use lib map { - my ( $m, $c ) = ( $_, qq{die "Can't locate $_ (hidden)\n"} ); - sub { return unless $_[1] eq $m; open my $fh, "<", \$c; return $fh } + my $m = $_; + sub { return unless $_[1] eq $m; die "Can't locate $m in \@INC (hidden).\n" }; } qw{Cpanel/JSON/XS.pm}; use Test::More 0.88; diff --git a/t/none.t b/t/none.t index 12faf52..12d26fd 100644 --- a/t/none.t +++ b/t/none.t @@ -3,8 +3,8 @@ use warnings; # hide Cpanel::JSON::XS, JSON::XS, JSON::PP use lib map { - my ( $m, $c ) = ( $_, qq{die "Can't locate $_ (hidden)\n"} ); - sub { return unless $_[1] eq $m; open my $fh, "<", \$c; return $fh } + my $m = $_; + sub { return unless $_[1] eq $m; die "Can't locate $m in \@INC (hidden).\n" }; } qw{Cpanel/JSON/XS.pm JSON/XS.pm JSON/PP.pm}; use Test::More 0.88; diff --git a/t/pp.t b/t/pp.t index 7fe1926..df3d2b3 100644 --- a/t/pp.t +++ b/t/pp.t @@ -3,8 +3,8 @@ use warnings; # hide Cpanel::JSON::XS, JSON::XS use lib map { - my ( $m, $c ) = ( $_, qq{die "Can't locate $_ (hidden)\n"} ); - sub { return unless $_[1] eq $m; open my $fh, "<", \$c; return $fh } + my $m = $_; + sub { return unless $_[1] eq $m; die "Can't locate $m in \@INC (hidden).\n" }; } qw{Cpanel/JSON/XS.pm JSON/XS.pm}; use if !eval { require JSON::PP; 1; }, 'Test::More', skip_all => 'No JSON::PP'; diff --git a/t/xs.t b/t/xs.t index 1fa4fa9..405e7f1 100644 --- a/t/xs.t +++ b/t/xs.t @@ -3,8 +3,8 @@ use warnings; # hide Cpanel::JSON::XS use lib map { - my ( $m, $c ) = ( $_, qq{die "Can't locate $_ (hidden)\n"} ); - sub { return unless $_[1] eq $m; open my $fh, "<", \$c; return $fh } + my $m = $_; + sub { return unless $_[1] eq $m; die "Can't locate $m in \@INC (hidden).\n" }; } qw{Cpanel/JSON/XS.pm}; use Test::More 0.88;