X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F28-uvar.t;h=d44f9f1f0b38ad3ff17446eef7ab53b6b7a9e0c3;hb=800e9f939f181af9766c3a3024ac9f57b9799510;hp=b0114ad67f5234b3d960f3f785c5eb609923dc10;hpb=b9df7824d4619174e28f9b1b5856c4a228d9cc7b;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/28-uvar.t b/t/28-uvar.t index b0114ad..d44f9f1 100644 --- a/t/28-uvar.t +++ b/t/28-uvar.t @@ -5,7 +5,7 @@ use warnings; use Test::More; -use Variable::Magic qw/wizard cast dispell VMG_UVAR/; +use Variable::Magic qw; if (VMG_UVAR) { plan tests => 2 * 15 + 12 + 14 + (4 * 2 * 2 + 1 + 1) + 1; @@ -17,7 +17,7 @@ use lib 't/lib'; use Variable::Magic::TestWatcher; use Variable::Magic::TestValue; -my $wiz = init_watcher [ qw/fetch store exists delete/ ], 'uvar'; +my $wiz = init_watcher [ qw ], 'uvar'; my %h = (a => 1, b => 2, c => 3); @@ -51,9 +51,10 @@ $x = watch { $h{a} } { fetch => 1 }, 'fetch directly with also non uvar magic'; is $x, 1, 'uvar: fetch directly with also non uvar magic correctly'; SKIP: { - eval "use Tie::Hash"; - skip 'Tie::Hash required to test uvar magic on tied hashes' => 2 * 5 + 4 if $@; - diag "Using Tie::Hash $Tie::Hash::VERSION" if defined $Tie::Hash::VERSION; + my $has_tie_hash = do { local $@; eval { require Tie::Hash; 1 } }; + skip 'Tie::Hash required to test uvar magic on tied hashes' + => 2 * 5 + 4 unless $has_tie_hash; + defined and diag "Using Tie::Hash $_" for $Tie::Hash::VERSION; tie my %h, 'Tie::StdHash'; %h = (x => 7, y => 8);