use Test::More;
use Eval::WithLexicals;
+use lib 't/lib';
my $eval = Eval::WithLexicals->with_plugins("HintPersistence")->new(prelude => '');
);
# Assumption about perl internals: sort pragma will set a key in %^H.
-
-$eval->eval(q{ { use sort 'stable' } }),
-ok !exists $eval->hints->{q{%^H}}->{sort},
+$eval->eval(q{ { use hint_hash_pragma 'param' } }),
+ok !exists $eval->hints->{q{%^H}}->{hint_hash_pragma},
"Lexical pragma used below main scope not captured";
-$eval->eval(q{ use sort 'stable' }),
-ok exists $eval->hints->{q{%^H}}->{sort},
+$eval->eval(q{ use hint_hash_pragma 'param' }),
+is $eval->hints->{q{%^H}}->{hint_hash_pragma}, 'param',
"Lexical pragma captured";
done_testing;
--- /dev/null
+package hint_hash_pragma;
+use strictures 1;
+
+sub import {
+ my ($class, $val) = @_;
+ $^H |= 0x20000;
+ $^H{hint_hash_pragma} = $val;
+}
+
+1;