On Tue, Sep 09, 2003 at 08:50:06PM +0100, Fergal Daly wrote: > The docs for is() says it uses eq, is_deeply() says it looks inside, it > doesn't say "looks inside sometimes".
It says it looks inside listrefs and hashrefs. That's all. Objects are not listrefs and hashrefs. They are sometimes made *from* such, but they are not such. The fact the is_deeply currently looks inside them is a bug. > A test that sometimes tests one thing and sometimes tests another and no way > to know which it did is kind of pointless. When it says "OK", what's it > saying OK to? This is a silly argument. No-one is ever saying this. You are just claiming that they are. > A _crucial_ point is that the test author has no control over when the walking > and comparing get swapped. The data you are trying to test actually controls > it. And...? Of course this is so. That's the point. *all* of the test functions currently exhibit this behaviour. > You wouldn't trust security at an airport that asks you "metal detector or > paddown today sir?" and so you can't trust a test function that lets the > tested data control the test. You wouldn't trust an ice-cream vendor who had a pink goatee and a cowboy hat either, would you? I really wish you'd stop throwing out such ludicrous examples that only serve to distract from the issues. > > is_deeply() shouldn't look at the single elements differently than ok() or > > is() do. (Well, my theorie :) > But it has to look at them differently otherwise how can it figure out if it > needs to walk into them? if ref($elem) eq "HASH" or ref($elem) eq "ARRAY". That's all that's needed to behave as per the docs. > You may be thinking of is_deeply as something that just looks inside the first > level and then applies is() to everything it finds. That's not what it is and > that's not what it's supposed to be, I doubt anyone believes this. It is possible for people to not believe your Obvious Truth without this ... Tony