X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F35-stash.t;fp=t%2F35-stash.t;h=d1fc7a480f177145555f10327634a64ca5cf837a;hb=3bc98bdbdb230943e7fb3135e325f10013acac2d;hp=6be01aa550eaf7b339b82cf1d4beeb5c0e062b1f;hpb=159e8ad7c747edb4a25db2f2673bbe143531f347;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/35-stash.t b/t/35-stash.t index 6be01aa..d1fc7a4 100644 --- a/t/35-stash.t +++ b/t/35-stash.t @@ -5,7 +5,10 @@ use warnings; use Test::More; -use Variable::Magic qw/wizard cast dispell VMG_UVAR VMG_OP_INFO_NAME VMG_OP_INFO_OBJECT/; +use Variable::Magic qw< + wizard cast dispell + VMG_UVAR VMG_OP_INFO_NAME VMG_OP_INFO_OBJECT +>; my $run; if (VMG_UVAR) { @@ -27,7 +30,7 @@ $_ => sub { () } CB -} qw/fetch store exists delete/); +} qw); $code .= ', data => sub { +{ guard => 0 } }'; @@ -51,8 +54,8 @@ cast %Hlagh::, $wiz; is $@, "ok\n", 'stash: variables compiled fine'; is_deeply \%mg, { - fetch => [ qw/thing stuff/ ], - store => [ qw/thing stuff/ ], + fetch => [ qw ], + store => [ qw ], }, 'stash: variables'; } @@ -70,7 +73,7 @@ cast %Hlagh::, $wiz; is $@, "ok\n", 'stash: function definitions compiled fine'; is_deeply \%mg, { - store => [ qw/eat shoot leave shoot/ ], + store => [ qw ], }, 'stash: function definitions'; } @@ -88,7 +91,7 @@ cast %Hlagh::, $wiz; roam(); }; - my @calls = qw/eat shoot leave roam yawn roam/; + my @calls = qw; is $@, "ok\n", 'stash: function calls compiled fine'; is_deeply \%mg, { @@ -104,7 +107,7 @@ cast %Hlagh::, $wiz; is $@, '', 'stash: valid method call ran fine'; is_deeply \%mg, { - fetch => [ qw/shoot/ ], + fetch => [ qw ], }, 'stash: valid method call'; } @@ -115,7 +118,7 @@ cast %Hlagh::, $wiz; is $@, '', 'stash: second valid method call ran fine'; is_deeply \%mg, { - fetch => [ qw/shoot/ ], + fetch => [ qw ], }, 'stash: second valid method call'; } @@ -126,7 +129,7 @@ cast %Hlagh::, $wiz; is $@, '', 'stash: valid dynamic method call ran fine'; is_deeply \%mg, { - store => [ qw/shoot/ ], + store => [ qw ], }, 'stash: valid dynamic method call'; } @@ -142,7 +145,7 @@ cast %Hlagh::, $wiz; is $@, '', 'inherited valid method call ran fine'; is_deeply \%mg, { - fetch => [ qw/ISA leave/ ], + fetch => [ qw ], }, 'stash: inherited valid method call'; } @@ -162,7 +165,7 @@ cast %Hlagh::, $wiz; is $@, '', 'inherited previously called valid method call ran fine'; is_deeply \%mg, { - fetch => [ qw/shoot/ ], + fetch => [ qw ], }, 'stash: inherited previously called valid method call'; } @@ -182,8 +185,8 @@ cast %Hlagh::, $wiz; like $@, qr/^Can't locate object method "unknown" via package "Hlagh"/, 'stash: invalid method call croaked'; is_deeply \%mg, { - fetch => [ qw/unknown/ ], - store => [ qw/unknown AUTOLOAD/ ], + fetch => [ qw ], + store => [ qw ], }, 'stash: invalid method call'; } @@ -194,7 +197,7 @@ cast %Hlagh::, $wiz; like $@, qr/^Can't locate object method "unknown_too" via package "Hlagh"/, 'stash: invalid dynamic method call croaked'; is_deeply \%mg, { - store => [ qw/unknown_too AUTOLOAD/ ], + store => [ qw ], }, 'stash: invalid dynamic method call'; } @@ -205,7 +208,7 @@ cast %Hlagh::, $wiz; like $@, qr/^Can't locate object method "also_unknown" via package "Hlagher"/, 'stash: invalid inherited method call croaked'; is_deeply \%mg, { - fetch => [ qw/also_unknown AUTOLOAD/ ], + fetch => [ qw ], }, 'stash: invalid method call'; } @@ -222,7 +225,7 @@ cast %Hlagh::, $wiz; is $@, '', 'stash: delete executed fine'; is_deeply \%mg, { store => [ - qw/nevermentioned nevermentioned eat eat shoot shoot nevermentioned/ + qw ], }, 'stash: delete'; } @@ -236,7 +239,7 @@ dispell %Hlagh::, $wiz; { package AutoHlagh; - use vars qw/$AUTOLOAD/; + use vars qw<$AUTOLOAD>; sub AUTOLOAD { return $AUTOLOAD } } @@ -252,8 +255,8 @@ cast %AutoHlagh::, $wiz; is $res, 'AutoHlagh::autoloaded', 'stash: autoloaded method call returned the right thing'; is_deeply \%mg, { - fetch => [ qw/autoloaded/ ], - store => [ qw/autoloaded AUTOLOAD AUTOLOAD/ ], + fetch => [ qw ], + store => [ qw ], }, 'stash: autoloaded method call'; } @@ -273,8 +276,8 @@ cast %AutoHlagh::, $wiz; is $res, 'AutoHlagher::also_autoloaded', 'stash: inherited autoloaded method returned the right thing'; is_deeply \%mg, { - fetch => [ qw/also_autoloaded AUTOLOAD/ ], - store => [ qw/AUTOLOAD/ ], + fetch => [ qw ], + store => [ qw ], }, 'stash: inherited autoloaded method call'; } @@ -291,7 +294,7 @@ $_ => sub { () } CB -} qw/fetch store exists delete/); +} qw); my $uo_exp = $] < 5.011002 ? 2 : 3;