On Wed, Dec 12, 2001 at 08:54:51PM -0500, Michael G Schwern wrote:
> On Wed, Dec 12, 2001 at 04:38:20PM -0500, Barrie Slaymaker wrote:
> > I've written a Test::Differences[1] that outputs things like:
> > 
> >     not ok 5
> >     # Failed test 5 in blib/lib/Test/Differences.pm at line 221 fail #4 *TODO*
> >     # +-----+----------+
> >     # | Got | Expected |
> >     # +-----+----------+
> >     # | a\n | a\n      |
> >     # >xxxxx* b\n      <
> >     # | c\n | c\n      |
> >     # >xxxxx* d\n      <
> >     # | e\n | e\n      |
> >     # +-----+----------+
> > 
> > when passed strings, arrays of strings, arrays of hashes, or arrays of
> > arrays of strings (basically, all the result types DBI's fetchall_...()
> > methods can return plus whole strings).
> 
> Oooooooh, pretty.  Beats the hell out of is_deeply.

Only for "table" structured data.  Since older Data::Dumpers don't sort
hash keys, and I haven't integrated the Data::Dumper like code I have
elsewhere, it isn't generalized to handle all data structures.

> Mind if I steal it? :)

Not at all, but you'll need to steal Algortihm::Diff (and, for the
moment, Text::Diff, but I want to remove that necessity).

> > I would like to make Test::Differences autodetect Test::More and others
> > like it so it can extend them "seamlessly" like so:
> 
> In that case base yourself on Test::Builder and it should all Just
> Work.

Bingo, that should do the trick.

> > and if there's an equivalent way to "mix in" with Test.pm.
> 
> You can use unpublished bits like $Test::ntest.  It should be safe
> since Test.pm is stable (ie. dead).

:) I was hoping you'd say that.  I've done that before for
internal-use-only stuff (read "hacks too embarassing to release" :), so
I'll do it here.

Thanks,

Barrie

Reply via email to