8 use Variable::Magic qw/wizard cast dispell VMG_UVAR VMG_OP_INFO_NAME VMG_OP_INFO_OBJECT/;
15 plan skip_all => 'uvar magic is required to test symbol table hooks';
21 . join (', ', map { <<CB;
24 return 0 if \$d->{guard};
25 local \$d->{guard} = 1;
26 push \@{\$mg{$_}}, \$_[2];
30 } qw/fetch store exists delete/);
32 $code .= ', data => sub { +{ guard => 0 } }';
52 is $@, "ok\n", 'stash: variables compiled fine';
56 }, 'stash: variables';
70 is $@, "ok\n", 'stash: function calls compiled fine';
72 fetch => [ qw/foo bar foo/ ],
73 store => [ qw/foo bar foo/ ],
74 }, 'stash: function calls';
85 is $@, '', 'stash: delete executed fine';
87 store => [ qw/foo foo foo/ ],
92 is_deeply \%mg, { }, 'stash: magic that remains at END time' if $run;
95 dispell %Hlagh::, $wiz;
98 . join (', ', map { <<CB;
101 return 0 if \$d->{guard};
102 local \$d->{guard} = 1;
103 is \$_[3], undef, 'stash: undef op';
107 } qw/fetch store exists delete/);
109 $code .= ', data => sub { +{ guard => 0 } }';
111 $wiz = eval $code . ', op_info => ' . VMG_OP_INFO_NAME;
122 is $@, "ok\n", 'stash: function call with op name compiled fine';
124 dispell %Hlagh::, $wiz;
126 $wiz = eval $code . ', op_info => ' . VMG_OP_INFO_OBJECT;
137 is $@, "ok\n", 'stash: function call with op object compiled fine';
139 dispell %Hlagh::, $wiz;