X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F25-copy.t;h=04ed1c95fbd65d64a904c26a6498fc8c3ef7d7d0;hb=30631ed72aef81f7a424009effb91f408481463e;hp=a18022f057488ca669b7375f790fe95387dc2bcd;hpb=3bc98bdbdb230943e7fb3135e325f10013acac2d;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/25-copy.t b/t/25-copy.t index a18022f..04ed1c9 100644 --- a/t/25-copy.t +++ b/t/25-copy.t @@ -5,13 +5,9 @@ use warnings; use Test::More; -use Variable::Magic qw; +use Variable::Magic qw; -if (MGf_COPY) { - plan tests => 2 + ((2 * 5 + 3) + (2 * 2 + 1)) + (2 * 9 + 6) + 1; -} else { - plan skip_all => 'No copy magic for this perl'; -} +plan tests => 2 + ((2 * 5 + 3) + (2 * 2 + 1)) + (2 * 9 + 6) + 1; use lib 't/lib'; use Variable::Magic::TestWatcher; @@ -20,9 +16,9 @@ use Variable::Magic::TestValue; my $wiz = init_watcher 'copy', 'copy'; SKIP: { - eval "use Tie::Array"; + my $has_tie_array = do { local $@; eval { require Tie::Array; 1 } }; skip 'Tie::Array required to test copy magic on arrays' - => (2 * 5 + 3) + (2 * 2 + 1) if $@; + => (2 * 5 + 3) + (2 * 2 + 1) unless $has_tie_array; defined and diag "Using Tie::Array $_" for $Tie::Array::VERSION; tie my @a, 'Tie::StdArray'; @@ -55,8 +51,9 @@ SKIP: { } SKIP: { - eval "use Tie::Hash"; - skip 'Tie::Hash required to test copy magic on hashes' => 2 * 9 + 6 if $@; + my $has_tie_hash = do { local $@; eval { require Tie::Hash; 1 } }; + skip 'Tie::Hash required to test copy magic on hashes' + => 2 * 9 + 6 unless $has_tie_hash; defined and diag "Using Tie::Hash $_" for $Tie::Hash::VERSION; tie my %h, 'Tie::StdHash';