8 eval "use Symbol qw/gensym/";
10 plan skip_all => "Symbol::gensym required for testing magic for globs";
12 plan tests => 2 * 8 + 1;
13 diag "Using Symbol $Symbol::VERSION" if defined $Symbol::VERSION;
16 use Variable::Magic qw/cast dispell VMG_COMPAT_GLOB_GET/;
18 my %get = VMG_COMPAT_GLOB_GET ? (get => 1) : ();
21 use Variable::Magic::TestWatcher;
23 my $wiz = init_watcher
24 [ qw/get set len clear free copy dup local fetch store exists delete/ ],
29 watch { cast *a, $wiz } +{ }, 'cast';
31 watch { local *b = *a } +{ %get }, 'assign to';
33 watch { *a = gensym() } +{ %get, set => 1 }, 'assign';
37 watch { cast *b, $wiz } +{ }, 'cast 2';
40 watch { undef *a } +{ %get }, 'undef';
42 watch { dispell *a, $wiz } +{ %get }, 'dispell';