2 # Test that PL_check hooks for RV2*V can override symbol lookups.
4 # So far we only test RV2CV.
7 use Test::More tests => 4;
10 setup_rv2cv_addunderbar;
11 $^H{'XS::APItest/addunder'} = 1; # make foo() actually call foo_()
14 sub foo_ { @_ ? shift . "___" : "phew" }
18 # Make sure subs looked up via rv2cv check hooks are not treated as second-
21 BEGIN { # If there is a foo symbol, this test will not be testing anything.
25 is((foo bar), 'bar___');
27 is((foo $bar), 'baz___');
29 # Proto should cause goo() to override Foo->goo interpretation.
31 sub goo_ (*) { shift . "===" }
32 is((goo Foom), "Foom===");