]> git.vpit.fr Git - perl/modules/Lexical-Types.git/blobdiff - t/18-hints.t
The last argument to hv_fetch is the lvalue flag, not the hash
[perl/modules/Lexical-Types.git] / t / 18-hints.t
diff --git a/t/18-hints.t b/t/18-hints.t
new file mode 100644 (file)
index 0000000..2b0886c
--- /dev/null
@@ -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';
+}