]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/25-copy.t
Update VPIT::TestHelpers to e8344578
[perl/modules/Variable-Magic.git] / t / 25-copy.t
index 7e13dfdf324fdd525986dbaba8b23456f23d9a1f..394449541b3ab123f7ff015b0bf16834ab77c3a1 100644 (file)
@@ -5,13 +5,12 @@ use warnings;
 
 use Test::More;
 
-use Variable::Magic qw<cast dispell MGf_COPY>;
+use lib 't/lib';
+use VPIT::TestHelpers;
 
-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';
-}
+use Variable::Magic qw<cast dispell>;
+
+plan tests => 2 + ((2 * 5 + 3) + (2 * 2 + 1)) + (2 * 9 + 6) + 1;
 
 use lib 't/lib';
 use Variable::Magic::TestWatcher;
@@ -20,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);
@@ -55,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);