X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F22-magic.t;h=350cbe17d4fb5dbb8607c81c051b74633ebc617c;hb=40ef72f0c01074b9767916dee4cb8eb478929e6f;hp=d4212534ebf0343a7522e2f23b850676b466943e;hpb=06cb3f3506161a118dc440264dcabcd612b9432c;p=perl%2Fmodules%2FLexical-Types.git diff --git a/t/22-magic.t b/t/22-magic.t index d421253..350cbe1 100644 --- a/t/22-magic.t +++ b/t/22-magic.t @@ -7,7 +7,7 @@ use Test::More; BEGIN { plan skip_all => 'Variable::Magic required to test magic' - unless eval "use Variable::Magic 0.31; 1"; + unless eval "use Variable::Magic; 1"; } { @@ -28,7 +28,8 @@ BEGIN { { package Str; } BEGIN { - plan tests => 2 * 6; + plan tests => 2 * 8; + defined and diag "Using Variable::Magic $_" for $Variable::Magic::VERSION; } use Lexical::Types as => 'Lexical::Types::Test'; @@ -47,11 +48,18 @@ sub check (&$$;$) { } else { eval { $test->() }; } + local $Test::Builder::Level = $Test::Builder::Level + 1; is_deeply $got, $exp, $desc; } return $want ? @ret : $ret[0]; } +sub zzz { + my $d = Variable::Magic::getdata($_[0], $Lexical::Types::Test::Str::wiz); + isnt $d, undef, 'typed lexicals are tagged'; + is ref($d), 'HASH', 'typed lexicals are correctly tagged'; +} + for (1 .. 2) { my Str $x = "abc"; @@ -64,4 +72,6 @@ for (1 .. 2) { my Str $z; check { $z = "bar" . $x } $z, { set => 1 }, 'scalar assign'; is $z, 'barabcfoo', 'scalar assign correctly'; + + zzz($z); }