|go ahead... be a heretic|
Problem defining a Test::Deep structure to match this arrayrefby mje (Curate)
|on May 12, 2010 at 14:56 UTC||Need Help??|
mje has asked for the wisdom of the Perl Monks concerning the following question:
I use Test::Deep quite a bit and like it but the following structure has defeated me as to coming up with a matching structure:
so I get:[11,22,[,[-1]]]
The closest I've got is:
but it does not handle a) the optional $id_re at the top level and the subbagof allows none. I tried to put it all in a subbagof but the problem with subbags is it depends on what matches first.
Obviously I could test to see if it is an arrayref then use one of 2 patterns depending on whether the array contains 2 or 3 items but that seems like a cop out.