summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-07-29 13:14:40 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-07-29 13:14:40 -0700
commit2f14e398cab171c93c6228512985ee84aa35be83 (patch)
tree9f2839f0fa19e8be5a2130142163f7a632d070f5 /ext
parent50dc2bd3d35d30eddfffb841752c40e125e49edc (diff)
downloadperl-2f14e398cab171c93c6228512985ee84aa35be83.tar.gz
Make undef &foo remove call checkers
The fact that the call checker is stored in magic is an implementation detail. cv_undef does not free magic, so the call checker lives on. If we were to move the parameter prototype into magic internally, we would not want undef to stop clearing it. To me, the current situa- tion with call checkers is similar.
Diffstat (limited to 'ext')
-rw-r--r--ext/XS-APItest/t/call_checker.t11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/XS-APItest/t/call_checker.t b/ext/XS-APItest/t/call_checker.t
index 429cea6b9b..b01323a75e 100644
--- a/ext/XS-APItest/t/call_checker.t
+++ b/ext/XS-APItest/t/call_checker.t
@@ -1,6 +1,6 @@
use warnings;
use strict;
-use Test::More tests => 67;
+use Test::More tests => 70;
use XS::APItest;
@@ -169,4 +169,13 @@ is $@, "";
is_deeply $foo_got, [ qw(a b), qw(a b c) ];
is $foo_ret, "z";
+cv_set_call_checker_lists(\&foo);
+undef &foo;
+$foo_got = undef;
+eval 'sub foo($@) { $foo_got = [ @_ ]; return "z"; }
+ $foo_ret = foo(@b, @c);';
+is $@, "";
+is_deeply $foo_got, [ 2, qw(a b c) ], 'undef clears call checkers';
+is $foo_ret, "z";
+
1;