Test::Deep without the Test part?

2007-09-05 Thread Gabor Szabo
I would like to compare data structure in some non-test code.
Test::Deep seems to give all the features I need, except that it is
integrated with
the testing framework.

How could I use that or what else should I use to compare two deep
data structures?

Gabor


Re: Test::Deep without the Test part?

2007-09-05 Thread demerphq
On 9/5/07, Gabor Szabo <[EMAIL PROTECTED]> wrote:
> I would like to compare data structure in some non-test code.
> Test::Deep seems to give all the features I need, except that it is
> integrated with
> the testing framework.
>
> How could I use that or what else should I use to compare two deep
> data structures?

Diff the output of Data::Dump::Streamer on the two objects. Or maybe
reuse the code contained in Test::Struct or Test::Deep.

Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"


Re: Test::Deep without the Test part?

2007-09-05 Thread Dominique Quatravaux
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Gabor Szabo a écrit :
> what else should I use to compare two deep data structures?

Data::Compare.


- --
<< Tout n'y est pas parfait, mais on y honore certainement les
jardiniers >>

Dominique Quatravaux <[EMAIL PROTECTED]>
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBRt5+B/TYH7KfeIIFAQLmfQP+P0nvmA/GBZWwM9MJ1gUy51LzRejXI+H0
X/VPIh32yub6UcHMgMQvQzGXadHBcWTwmoil9dMObmHMQW72uG/AC0T+XkF7e74f
0h84zzHYvAPQdg6/Ftnrk3/mDapmRFHP1P2gUvxN1qBUa+xwSbE6pvlRsmCVCPKY
ViTUhtsNX2w=
=0FIU
-END PGP SIGNATURE-




Re: Test::Deep without the Test part?

2007-09-05 Thread Fergal Daly
On 05/09/07, Gabor Szabo <[EMAIL PROTECTED]> wrote:
> I would like to compare data structure in some non-test code.
> Test::Deep seems to give all the features I need, except that it is
> integrated with
> the testing framework.

use Test::Deep::NoTest;
print "equal" if eq_deeply($a, $b);

but it's not documented and doesn't export as many comparators as
Test::Deep so it's not as convenient, I'll fix that. You can then use
eq_deeply to compare without involving Test::Builder. You don't get
the diagnostics though.

I'll try improve the situation over the weekend.

It's been on my todo list forever to make a Data::Deep module and just
call it from Test::Deep

F

> How could I use that or what else should I use to compare two deep
> data structures?
>
> Gabor
>


Prove cut'n'paste

2007-09-05 Thread Andy Lester
 http://search.cpan.org/src/ANDYA/Test-Harness-2.99_01/bin/prove

The two lines at the top

eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
  if 0;# not running under some shell

should not be in the distro.  Those get put in at "make install" time.

xoa

-- 
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance


Re: Prove cut'n'paste

2007-09-05 Thread Andy Armstrong

On 5 Sep 2007, at 16:31, Andy Lester wrote:

eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
  if 0;# not running under some shell

should not be in the distro.  Those get put in at "make install" time.


Fixed as 420, thanks.

--
Andy Armstrong, hexten.net