Subject: | Does not test for response-equivalence to actual UNIVERSAL::can |
Warnings aside, the intent of UNIVERSAL::can is to behave like the default case for non-callable things.
But the test scripts to not systematically cover the non-invocable cases to check that this is the case (the undef example in the script being just one case).
You should also add all of the following and call both UNIVERSAL::can directly, then your replaced version, and check the results.
undef,
'',
0,
\'',
[],
{},
sub foo {},
etc
etc
Pretty much just create a list of whatever crazy evil stuff you can dream up and interate the list testing equivalence.
Otherwise how am I to trust that it actually will return the same... The UNIVERSAL::isa case doesn't do this either, and I managed to find 3 failures in a few minutes.