From: Vincent Pit Date: Thu, 12 Mar 2015 14:02:08 +0000 (-0300) Subject: Make t/14-refs.t pass on perl 5.21 X-Git-Tag: v0.10~2 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=3aeb72ad594397b579a9cdcbc8b58aa7308e8f97;p=perl%2Fmodules%2FB-RecDeparse.git Make t/14-refs.t pass on perl 5.21 At some point in the 5.21.x branch, B::Deparse has started to deparse sub references as fully qualified names under "use strict 'vars'". We just turn this stricture off while compiling the test cases for the time being. --- diff --git a/t/14-refs.t b/t/14-refs.t index 026a908..c57fbe3 100644 --- a/t/14-refs.t +++ b/t/14-refs.t @@ -7,11 +7,16 @@ use Test::More tests => 2 * (4 + 3) * 4; use B::RecDeparse; -sub dummy { } -sub add { $_[0] + $_[1] } -sub call ($$$) { my $x = \&dummy; $_[0]->($_[1], $_[2]) } -sub foo { call(\&add, $_[0], 1); } -sub bar { my $y = \&call; $y->(\&add, $_[0], 1); } +{ + BEGIN { + strict->unimport('vars') if "$]" >= 5.021; + } + sub dummy { } + sub add { $_[0] + $_[1] } + sub call ($$$) { my $x = \&dummy; $_[0]->($_[1], $_[2]) } + sub foo { call(\&add, $_[0], 1); } + sub bar { my $y = \&call; $y->(\&add, $_[0], 1); } +} sub which { my ($brd, $coderef, $yfunc, $yref, $nfunc, $nref, $l) = @_;