]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - t/34-glob.t
A bare glob that isn't part of a fetch doesn't call get magic anymore in 5.13.7
[perl/modules/Variable-Magic.git] / t / 34-glob.t
index de5c64cdf16ed408e3be995775656dfbf860f9e8..b5c8394fd86d3e43b483c5631a0fd45d08faf718 100644 (file)
@@ -9,7 +9,7 @@ eval "use Symbol qw/gensym/";
 if ($@) {
  plan skip_all => "Symbol::gensym required for testing magic for globs";
 } else {
- plan tests => 2 * 8 + 1;
+ plan tests => 2 * 12 + 1;
  diag "Using Symbol $Symbol::VERSION" if defined $Symbol::VERSION;
 }
 
@@ -30,13 +30,20 @@ watch { cast *a, $wiz } +{ }, 'cast';
 
 watch { local *b = *a } +{ %get }, 'assign to';
 
-watch { *a = gensym() } +{ %get, set => 1 }, 'assign';
+watch { *a = \1 }          +{ %get, set => 1 }, 'assign scalar slot';
+watch { *a = [ qw/x y/ ] } +{ %get, set => 1 }, 'assign array slot';
+watch { *a = { u => 1 } }  +{ %get, set => 1 }, 'assign hash slot';
+watch { *a = sub { } }     +{ %get, set => 1 }, 'assign code slot';
+
+watch { *a = gensym() }    +{ %get, set => 1 }, 'assign glob';
 
 watch {
  local *b = gensym();
  watch { cast *b, $wiz } +{ }, 'cast 2';
 } +{ }, 'scope end';
 
+%get = () if $] >= 5.013007;
+
 watch { undef *a } +{ %get }, 'undef';
 
 watch { dispell *a, $wiz } +{ %get }, 'dispell';