Subject: | Undocumented inconsistency between unfiltered and filtered output |
There are a few anomalies in the difference between unfiltered and filtered lists, which are not documented.
The most obvious ones are 'isa' and 'can'. These methods are returned by ->get_all_symbols() , but not returned by ->get_all_symbols('CODE'), or any other call to ->get_all_symbols with a type_filter.
The confusing one is DESTROY, which comes up, despite being one of the subs I had expected not to be returned, is returned : "Note that if the package contained any BEGIN blocks, perl will leave an empty typeglob in the BEGIN slot, so this will show up if no filter is used (and similarly for INIT, END, etc)."
I had imagined "DESTROY" would be in the "etc" . Mostly because of the all caps deal, and that I never use DESTROY myself, and that, I'd forgotten that DESTROY is not END, but just a real method created by moose like 'new'. But perhaps it would be more appropriate to list all the 'GLOBS' that a user can expect to be visible without a type filter, but not with a type filter, instead of just stating 'etc'.
Attached test ,
Output:
prove /tmp/t.pl
/tmp/t.pl .. # Package Stash version: 0.33 , Implementation: XS
/tmp/t.pl .. 1/?
# Failed test 'Key "can" not found'
# at /tmp/t.pl line 59.
# Failed test 'Key "isa" not found'
# at /tmp/t.pl line 59.
# Failed test 'Unexpected key "DESTROY" found'
# at /tmp/t.pl line 62.
# Looks like you failed 3 tests of 5.
Show quoted text
# at /tmp/t.pl line 69.
# Looks like you failed 1 test of 6.
Failed 1/6 subtests
Test Summary Report
-------------------
/tmp/t.pl (Wstat: 256 Tests: 6 Failed: 1)
Failed test: 2
Non-zero exit status: 1
Files=1, Tests=6, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.21 cusr 0.01 csys = 0.25 CPU)
Result: FAIL
Subject: | t.pl |