Re: [code-review] Please review String::FlexMatch
Tony Bowden <[email protected]> Mon, 8 Sep 2003 10:53:48 +0100
| Newsgroups | gmane.comp.lang.perl.code-review-ladder |
|---|---|
| Message-ID | <[email protected]> |
On Sun, Sep 07, 2003 at 11:26:04PM +0100, Fergal Daly wrote:
> > Sounds like the wrong place to put it to me ... how does is() cope with
> > two overloaded references? is_deeply should do it the same way (ideally
> > by just calling is ...)
> If you're going to do it, I think Marcel is right.
> You can't call is() as this will trigger a full test result. Actually, is() is
> just shorthand for Test::Builder->is_eq, which I think think is a better name
> as it's more explicit.
Yes, but the point remains that they should both call the same
comparison code. I don't care where it is, but they should both follow
the same path, not add their own.
I'd see the structure as being something like:
sub is { do_compare($X, $Y) and report )
sub is_deeply {
while ($X = $struct1->next, $Y = $struct2->next) {
do_compare($X, $Y) and gather reports
}
report based on gathered reports
}
No comparison behaviour whatsoever should live in is_deeply.
Tony