From: Vincent Pit Date: Thu, 5 Mar 2009 21:12:10 +0000 (+0100) Subject: Test magical tags X-Git-Tag: v0.03~1 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLexical-Types.git;a=commitdiff_plain;h=2af4044e8de9d372ccadd43070cf72f0ff951eae Test magical tags --- diff --git a/t/22-magic.t b/t/22-magic.t index 80bee6f..f1ec1f9 100644 --- a/t/22-magic.t +++ b/t/22-magic.t @@ -28,7 +28,7 @@ BEGIN { { package Str; } BEGIN { - plan tests => 2 * 6; + plan tests => 2 * 8; } use Lexical::Types as => 'Lexical::Types::Test'; @@ -52,6 +52,12 @@ sub check (&$$;$) { 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 +70,6 @@ for (1 .. 2) { my Str $z; check { $z = "bar" . $x } $z, { set => 1 }, 'scalar assign'; is $z, 'barabcfoo', 'scalar assign correctly'; + + zzz($z); }