On 7/1/05, Fergal Daly <[EMAIL PROTECTED]> wrote:
> On 7/1/05, Michael G Schwern <[EMAIL PROTECTED]> wrote:
> > is_deeply() is not about exact equivalence.  Its about making a best fit
> > function for the most common uses.  I think most people expect [$a, $a] and
> > [$b,$c] to come out equal.
> >
> > Test::Deep is for tweaked deep comparisons.
> 
> Test::Deep doesn't do what Yves wants. I've been aware of the problem
> pretty much since I wrote it, I think the technical term for what Yves
> wants is bisimulation. It's not trivial to add to is_deeply or TD but
> TD already has a comparison cache with transactions which is part of
> the solution so I think it would be possible to add it and make it
> configurable,

Its actually very simple to add to is_deeply. You simply maintain two
visited hashes and compare the visit counts when you enter a
reference. If there is a mismatch the structures are different.

Also, the addition to the interface that im proposing (ie
looks_like()) would reuse the same code with a flag to determine which
behaviour to use.

yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Reply via email to