X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F22-magic.t;h=dee87c2ebeb5bc368e7e66fadc0a4a0898599bc7;hb=769ddb7f96f8f50f1f0d40459501e00672a31e1b;hp=350cbe17d4fb5dbb8607c81c051b74633ebc617c;hpb=1a89808e0eb3e27e0d2b61d0bfa84fa8ab94b9cb;p=perl%2Fmodules%2FLexical-Types.git diff --git a/t/22-magic.t b/t/22-magic.t index 350cbe1..dee87c2 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 { @@ -21,7 +23,7 @@ BEGIN { get => sub { ++$_[1]->{get}; () }, set => sub { ++$_[1]->{set}; () }; } - + sub TYPEDSCALAR { cast $_[1], $wiz, $_[2]; () } } @@ -29,7 +31,6 @@ BEGIN { BEGIN { plan tests => 2 * 8; - defined and diag "Using Variable::Magic $_" for $Variable::Magic::VERSION; } use Lexical::Types as => 'Lexical::Types::Test'; @@ -40,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) {