]> git.vpit.fr Git - perl/modules/Lexical-Types.git/blob - t/18-hints.t
2b0886cdc09e8f08517bfad261e669aa93a8a8fc
[perl/modules/Lexical-Types.git] / t / 18-hints.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 2;
7
8 {
9  local %^H = (a => 1);
10
11  require Lexical::Types;
12
13  my $err = do {
14   local $@;
15   eval <<'  VIVIFICATION_TEST';
16    package Lexical::Types::TestVivification;
17    sub TYPEDSCALAR { }
18    my Lexical::Types::TestVivification $lexical;
19   VIVIFICATION_TEST
20   $@;
21  };
22
23  # Force %^H repopulation with an Unicode match
24  my $x = "foo";
25  utf8::upgrade($x);
26  $x =~ /foo/i;
27
28  my $hints = join ',',
29               map { $_, defined $^H{$_} ? $^H{$_} : '(undef)' }
30                sort keys(%^H);
31  is $err,   '',    'vivification test code did not croak';
32  is $hints, 'a,1', 'Lexical::Types does not vivify entries in %^H';
33 }