use Test::More;
-use Variable::Magic qw/wizard cast dispell VMG_UVAR/;
+use Variable::Magic qw/wizard cast dispell VMG_UVAR VMG_OP_INFO_NAME VMG_OP_INFO_OBJECT/;
my $run;
if (VMG_UVAR) {
my $wiz = eval $code;
diag $@ if $@;
-{
- no strict 'refs';
- cast %{"Hlagh::"}, $wiz;
-}
+cast %Hlagh::, $wiz;
{
local %mg;
our $a;
{
package NotHlagh;
- my $x = @Hlagh::b;
+ our $x = @Hlagh::b;
}
};
is_deeply \%mg, { }, 'stash: magic that remains at END time' if $run;
}
-{
- no strict 'refs';
- dispell %{"Hlagh::"}, $wiz;
-}
+dispell %Hlagh::, $wiz;
$code = 'wizard '
. join (', ', map { <<CB;
$code .= ', data => sub { +{ guard => 0 } }';
-$wiz = eval $code . ', op_info => 1';
+$wiz = eval $code . ', op_info => ' . VMG_OP_INFO_NAME;
diag $@ if $@;
-{
- no strict 'refs';
- cast %{"Hlagh::"}, $wiz;
-}
+cast %Hlagh::, $wiz;
eval q{
die "ok\n";
meh();
};
-is $@, "ok\n", 'stash: function call with op_info 1 compiled fine';
+is $@, "ok\n", 'stash: function call with op name compiled fine';
-{
- no strict 'refs';
- dispell %{"Hlagh::"}, $wiz;
-}
+dispell %Hlagh::, $wiz;
-$wiz = eval $code . ', op_info => 2';
+$wiz = eval $code . ', op_info => ' . VMG_OP_INFO_OBJECT;
diag $@ if $@;
-{
- no strict 'refs';
- cast %{"Hlagh::"}, $wiz;
-}
+cast %Hlagh::, $wiz;
eval q{
die "ok\n";
wat();
};
-is $@, "ok\n", 'stash: function call with op_info 2 compiled fine';
+is $@, "ok\n", 'stash: function call with op object compiled fine';
-{
- no strict 'refs';
- dispell %{"Hlagh::"}, $wiz;
-}
+dispell %Hlagh::, $wiz;