On Tue 09 Apr 2002 18:02, Mark Fowler <[EMAIL PROTECTED]> wrote:
> On Tue, 9 Apr 2002, Michael G Schwern wrote:
> 
> > On Tue, Apr 09, 2002 at 03:26:21PM +0100, Mark Fowler wrote:
> > > There's a lot of other problems like that. So I was thinking of writing 
> > > Test::Sloppy (aka Test::Fuzzy, aka...)
> > 
> > What would it do?
> >
> > (I can show you lots of sloppy tests if you like. :)

Don't *overtest*.
If you go backporting this into core tests, think not only of the ease of new
methods of comparing, but also about the time it takes. Smoke testing has
proved to be vital for 5.8.0, and longer test runs (without added value)
reduce the number of configurations to be tested in the given time slot.

> Sorry, maybe it wasn't clear from the example.  sort of like eq_set meets 
> is_deeply.
> 
> Let's drag the example out again:
> 
>  wanted                           got
> 
>  [                                [
>    { a => "foo", b => "bar" },      { a => "baz", b => "qux" },
>    { a => "baz", b => "qux" },      { a => "foo", b => "bar" },
>  ]                                ]
> 
> This will of course fail with eq_set which just uses eq to compare items
> (which won't work for hashes), so although it'll cope happly with the fact
> that the elements aren't in the same order, it'll still fail.
> 
> (I got around this in my actual tests I just wrote by freezing the hashes 
> to flatten them then comparing both lists with eq_set)
> 
> Sloppy/Fuzzy would attempt to do away with such problems by sorting all 
> lists down to a defined level first.  Off the top of my head
> 
>    list_cmp_fuzzy($list1, $list2, 3)
> 
> would ignore all lists down to 3 levels.
> 
> Added other functionality to be introduced at a later date:
> 
>  a) Treating lists as hashes (i.e. they can be reordered at will but 
>     elements must be paired)
>  b) Doing proper set comparison (not bags)
>  c) Better handling of overloaded objects
> 
> And more ideas, if I can think of them.  Or more importantly, if you can.
> 
> Later.
> 
> Mark.
> 
> -- 
> s''  Mark Fowler                                     London.pm   Bath.pm
>      http://www.twoshortplanks.com/              [EMAIL PROTECTED]
> ';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/  +/
> ){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}
> 

-- 
H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.7.3 & 631 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
  WinNT 4, Win2K pro & WinCE 2.11.  Smoking perl CORE: [EMAIL PROTECTED]
http:[EMAIL PROTECTED]/   [EMAIL PROTECTED]
send smoke reports to: [EMAIL PROTECTED], QA: http://qa.perl.org

Reply via email to