On Thursday, February 27, 2003, at 09:21 pm, Fergal Daly wrote:


On Thursday 27 February 2003 20:54, [EMAIL PROTECTED] wrote:
On Thu, Feb 27, 2003 at 05:32:42PM +0000, Fergal Daly wrote:
I think that although a test that ignores blessed classes could be handy
in some circumstances (ie programming in general), I reckon in the
context of test suites it's a bug.

I am already not yet convinced. In particular, it makes this sort of test
more difficult than it needs be:


is_deeply($obj, { foo => 42, bar => 23 });

Absolutely, but there is currently no way to do this


is_deeply($obj, bless({ foo => 42, bar => 23 }, "MyClass"));

and get a fail if $obj is not in MyClass - as I found out today ;-(

2 solutions spring to mind
[snip]

Option three.

  isa_ok($obj, 'MyClass');
  is_deeply($obj, { foo => 42, bar => 23 });

:-)

Adrian



Reply via email to