On Thursday 27 February 2003 21:35, [EMAIL PROTECTED] wrote:
> On Thu, Feb 27, 2003 at 09:21:09PM +0000, Fergal Daly wrote:
>
> Or even better, cmp_objects().
Yep, sounds better.
> > - 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.
>
> This sounds too magical.
Magical how? It may be a bit too hard to explain and so it's probably a bad
idea. It's not that magical to implement though, it just requires something
like this in _deep_check
my ($class1, $base1) = ref($e1) =~ /^(.*)=(.*?)$/;
my ($class2, $base2) = ref($e2) =~ /^(.*)=(.*?)$/;
if ($base1 eq $base2 and ($class2 and $class1 eq $class2))
{
check the contents of $e1 and $e2
}
else
{
fail
}
Then you could get rid of all the UNIVERSAL::isa calls too.
Anyway, I think it's better to explicitly request full checking.
> Either way, Test::More's is_deeply() behavior isn't likely to change, so
> Test::Set will have to take care of it.
Would it be acceptable to add a third argument to _deep_check to switch on/off
bless checking, rather than having to reimplement the whole thing?
Test::Set is going to have to be renamed Test::EvenMore,
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