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 - create is_deeply_blessed - let _deep_check take it's cue from the second argument. If the second argument is blessed then be strict about the classes, if it's unblessed then ignore the classes. This should happen at all levels in the structures. The second option allows your test above to succeed as normal but also allows mine to be strict. The only tests which will suddenly start failing are ones where the tester has specified the class, in which case they probably wanted it to fail. This sounds a little over-complicated but in theory I think it's good, F -- Do you need someone with lots of Unix sysadmin and/or lots of OO software development experience? Go on, giz a job. My CV - http://www.fergaldaly.com/cv.html