X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F07-context_info.t;h=657285f7d7f7ac5d717b0e6124635a4acbaf09f3;hb=0f9ea972f35aa9749419b792f2a673288d9a63ca;hp=b32dba7670e39b963cad919597136f3fafa77b6c;hpb=b28b51b004d8c91c31c1832655c09d9d0469f813;p=perl%2Fmodules%2FScope-Upper.git diff --git a/t/07-context_info.t b/t/07-context_info.t index b32dba7..657285f 100644 --- a/t/07-context_info.t +++ b/t/07-context_info.t @@ -12,7 +12,7 @@ use Config qw<%Config>; # change ; and that doesn't fit well with how we're testing things. use lib 't/lib'; -use Test::Leaner tests => 19 + 6; +use Test::Leaner tests => 18 + 6; use Scope::Upper qw; @@ -51,6 +51,9 @@ sub expected { $warnings = sub { use warnings; (caller 0)[9] }->() if "$]" < 5.007 and not $^W; } + if (defined $warnings and $warnings =~ m/^\x55*$/) { + $warnings = $warnings::Bits{all}; + } my @exp = ( $pkg, @@ -80,7 +83,6 @@ sub setup () { is_deeply [ context_info ], $exp0, 'main : context_info'; is_deeply [ context_info(HERE) ], $exp0, 'main : context_info HERE'; -is_deeply [ context_info(UP) ], $exp0, 'main : context_info UP'; is_deeply [ context_info(-1) ], $exp0, 'main : context_info -1'; package Scope::Upper::TestPkg::A; BEGIN { ::setup } @@ -157,6 +159,9 @@ sub call { my @got = context_info(CALLER $depth); my @exp = caller $depth; defined and not $_ and $_ = '' for $exp[5]; + if (defined $exp[9] and $exp[9] =~ m/^\x55*$/) { + $exp[9] = $warnings::Bits{all}; + } is_deeply \@got, \@exp, "context_info vs caller $depth"; } }