]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/11-multiple.t
Importing Variable-Magic-0.09.tar.gz
[perl/modules/Variable-Magic.git] / t / 11-multiple.t
index 0c8da3969c937706c6715b4ae00ccd19734309b5..fc68cf22b04716f1179c22423d85e700d7377d8f 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 33 + 24 + 12;
+use Test::More tests => 33 + 24;
 
 use Variable::Magic qw/wizard cast dispell VMG_UVAR/;
 
@@ -131,41 +131,3 @@ SKIP: {
  ok(!$@, "dispell uvar magic 0 croaks ($@)");
  ok($res, 'dispell uvar magic 0 invalid');
 }
-
-SKIP: {
- eval "use Hash::Util::FieldHash qw/fieldhash/";
- skip 'Hash::Util::FieldHash required for testing uvar interaction', 12
-      unless VMG_UVAR && !$@;
-
- fieldhash(my %h);
-
- bless \(my $obj = {}), 'Variable::Magic::Test::Mock';
- $h{$obj} = 5;
-
- my ($w, $c) = (undef, 0);
-
- eval { $w = wizard fetch => sub { ++$c }, store => sub { --$c } };
- ok(!$@, "wizard with uvar creation error ($@)");
- ok(defined $w, 'wizard with uvar is defined');
- ok(ref($w) eq 'SCALAR', 'wizard with uvar is a scalar ref');
-
- my $res = eval { cast %h, $w };
- ok(!$@, "cast uvar magic on fieldhash croaks ($@)");
- ok($res, 'cast uvar magic on fieldhash invalid');
-
- my $s = $h{$obj};
- ok($s == 5, 'fetch magic on fieldhash doesn\'t clobber');
- ok($c == 1, 'fetch magic on fieldhash');
-
- $h{$obj} = 7;
- ok($c == 0, 'store magic on fieldhash');
- ok($h{$obj} == 7, 'store magic on fieldhash doesn\'t clobber'); # $c == 1
-
- $res = eval { dispell %h, $w };
- ok(!$@, "dispell uvar magic on fieldhash croaks ($@)");
- ok($res, 'dispell uvar magic on fieldhash invalid');
-
- $h{$obj} = 11;
- $s = $h{$obj};
- ok($s == 11, 'store/fetch on fieldhash after dispell still ok');
-}