X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=blobdiff_plain;f=t%2F25-copy.t;h=394449541b3ab123f7ff015b0bf16834ab77c3a1;hp=04ed1c95fbd65d64a904c26a6498fc8c3ef7d7d0;hb=93df7812b9a0da8cdfa57a107eb2f8f4b4744b49;hpb=fceb925d08fa5e96cf477963195c3c4f6dbede65 diff --git a/t/25-copy.t b/t/25-copy.t index 04ed1c9..3944495 100644 --- a/t/25-copy.t +++ b/t/25-copy.t @@ -5,6 +5,9 @@ use warnings; use Test::More; +use lib 't/lib'; +use VPIT::TestHelpers; + use Variable::Magic qw; plan tests => 2 + ((2 * 5 + 3) + (2 * 2 + 1)) + (2 * 9 + 6) + 1; @@ -16,10 +19,7 @@ use Variable::Magic::TestValue; my $wiz = init_watcher 'copy', 'copy'; SKIP: { - 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) unless $has_tie_array; - defined and diag "Using Tie::Array $_" for $Tie::Array::VERSION; + load_or_skip('Tie::Array', undef, undef, (2 * 5 + 3) + (2 * 2 + 1)); tie my @a, 'Tie::StdArray'; @a = (1 .. 10); @@ -51,10 +51,7 @@ SKIP: { } SKIP: { - 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; + load_or_skip('Tie::Hash', undef, undef, 2 * 9 + 6); tie my %h, 'Tie::StdHash'; %h = (a => 1, b => 2, c => 3);