From: Vincent Pit Date: Sun, 21 Nov 2010 13:42:06 +0000 (+0100) Subject: Add more glob tests X-Git-Tag: v0.45~4 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=commitdiff_plain;h=442d92f66e46ee6b39285eec14de33419f2854c9 Add more glob tests --- diff --git a/t/34-glob.t b/t/34-glob.t index de5c64c..a6f2637 100644 --- a/t/34-glob.t +++ b/t/34-glob.t @@ -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,7 +30,12 @@ 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();