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