X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F22-magic.t;h=cc8e497b30892328dd65509421cf6f0c6c9323b6;hb=edb71e7af0ed10c8b114f0aaab25ff1b20d4d99e;hp=f1ec1f969e2f14285ca44d024cce1b9282169f22;hpb=2af4044e8de9d372ccadd43070cf72f0ff951eae;p=perl%2Fmodules%2FLexical-Types.git diff --git a/t/22-magic.t b/t/22-magic.t index f1ec1f9..cc8e497 100644 --- a/t/22-magic.t +++ b/t/22-magic.t @@ -5,15 +5,17 @@ use warnings; use Test::More; +use lib 't/lib'; +use VPIT::TestHelpers; + BEGIN { - plan skip_all => 'Variable::Magic required to test magic' - unless eval "use Variable::Magic; 1"; + load_or_skip('Variable::Magic', undef, [ ], 'required to test magic'); } { package Lexical::Types::Test::Str; - use Variable::Magic qw/wizard cast/; + use Variable::Magic qw; our $wiz; BEGIN { @@ -39,7 +41,8 @@ sub check (&$$;$) { my $want = wantarray; my @ret; { - local @{$got}{qw/get set/}; delete @{$got}{qw/get set/}; + local @{$got}{qw}; + delete @{$got}{qw}; if ($want) { @ret = eval { $test->() }; } elsif (defined $want) { @@ -47,6 +50,7 @@ sub check (&$$;$) { } else { eval { $test->() }; } + local $Test::Builder::Level = $Test::Builder::Level + 1; is_deeply $got, $exp, $desc; } return $want ? @ret : $ret[0];