X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F18-hints.t;fp=t%2F18-hints.t;h=2b0886cdc09e8f08517bfad261e669aa93a8a8fc;hb=26192e1043cbd952cc7acaa033cc473ffd074085;hp=0000000000000000000000000000000000000000;hpb=01f4a56263ea94b515c77db74e3e918ef240f992;p=perl%2Fmodules%2FLexical-Types.git diff --git a/t/18-hints.t b/t/18-hints.t new file mode 100644 index 0000000..2b0886c --- /dev/null +++ b/t/18-hints.t @@ -0,0 +1,33 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More tests => 2; + +{ + local %^H = (a => 1); + + require Lexical::Types; + + my $err = do { + local $@; + eval <<' VIVIFICATION_TEST'; + package Lexical::Types::TestVivification; + sub TYPEDSCALAR { } + my Lexical::Types::TestVivification $lexical; + VIVIFICATION_TEST + $@; + }; + + # Force %^H repopulation with an Unicode match + my $x = "foo"; + utf8::upgrade($x); + $x =~ /foo/i; + + my $hints = join ',', + map { $_, defined $^H{$_} ? $^H{$_} : '(undef)' } + sort keys(%^H); + is $err, '', 'vivification test code did not croak'; + is $hints, 'a,1', 'Lexical::Types does not vivify entries in %^H'; +}