Perl Monk, Perl Meditation | |
PerlMonks |
Test::Deep::noclass propagationby choroba (Cardinal) |
on Sep 22, 2020 at 22:57 UTC ( [id://11122101]=perlquestion: print w/replies, xml ) | Need Help?? |
choroba has asked for the wisdom of the Perl Monks concerning the following question:
Let's pretend we have an object:
I want to verify that the object when cursed recursively will consist of
I thought Test::Deep's noclass should be able to tell me.
But it doesn't work:
Without an object, it works nicely:
I asked about it in #freenode and was pointed towards Test2::Tools::Compare. It was the first time I played with it, so maybe my code is a bit clumsy, but I was able to write a test that passes:
How to do the comparison with Test::Deep? I tried adding another noclass to the value, or even noclass(useclass(...)), but it always failed similarly.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Back to
Seekers of Perl Wisdom
|
|