Comparing Data Structures Slopply

2002-04-09 Thread Mark Fowler
So... In a previous thread I was talking about how eq_set() should be really called eq_bag(). Now, not that I've got too much on my plate already (see my fun todo) but I do have an itch to scratch... I'm fed up applying too much logic in my test suites. This is bad because: a) I spend too

Re: Comparing Data Structures Slopply

2002-04-09 Thread Michael G Schwern
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. :) -- Michael G. Schwern <[EMAIL PROTECTED]>

Re: Comparing Data Structures Slopply

2002-04-09 Thread Mark Fowler
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 yo

Re: Comparing Data Structures Slopply

2002-04-09 Thread H.Merijn Brand
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, ak

Re: Comparing Data Structures Slopply

2002-04-09 Thread Michael G Schwern
On Tue, Apr 09, 2002 at 05:02:32PM +0100, Mark Fowler 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...

Re: Comparing Data Structures Slopply

2002-04-09 Thread Curt Sampson
On Tue, 9 Apr 2002, Mark Fowler wrote: > On Tue, 9 Apr 2002, Michael G Schwern wrote: > > > What would it do? > > (I can show you lots of sloppy tests if you like. :) > > Sorry, maybe it wasn't clear from the example. sort of like eq_set meets > is_deeply. Well, I think he was just being a bit

Re: Comparing Data Structures Slopply

2002-04-10 Thread Mark Fowler
On Wed, 10 Apr 2002, Curt Sampson wrote: > > b) Doing proper set comparison (not bags) > > This I'm not sure about. You demonstrated some set comparison along > these lines a while back, did you not? eq_set() is really bag comparison. I want a test which returns true iff for every item in two

Re: Comparing Data Structures Slopply

2002-04-10 Thread Curt Sampson
On Wed, 10 Apr 2002, Mark Fowler wrote: > On Wed, 10 Apr 2002, Curt Sampson wrote: > > eq_set() is really bag comparison. Well, my point was, it *is* a set comparison if you pass it sets. The problem, in my view, is that perl lets you pass it something which is not a set. Thus, it seems perfectl

Re: Comparing Data Structures Slopply

2002-04-10 Thread Michael G Schwern
On Wed, Apr 10, 2002 at 08:57:30PM +0900, Curt Sampson wrote: > On Wed, 10 Apr 2002, Mark Fowler wrote: > > > On Wed, 10 Apr 2002, Curt Sampson wrote: > > > > eq_set() is really bag comparison. > > Well, my point was, it *is* a set comparison if you pass it sets. > The problem, in my view, is th

Re: Comparing Data Structures Slopply

2002-04-10 Thread Michael G Schwern
On Wed, Apr 10, 2002 at 02:03:51PM +0100, Nicholas Clark wrote: > On Wed, Apr 10, 2002 at 08:57:30PM +0900, Curt Sampson wrote: > > On Wed, 10 Apr 2002, Mark Fowler wrote: > > > > > On Wed, 10 Apr 2002, Curt Sampson wrote: > > > > > > eq_set() is really bag comparison. > > > > Well, my point was

Re: Comparing Data Structures Slopply

2002-04-10 Thread Michael G Schwern
On Wed, Apr 10, 2002 at 11:32:04AM +0100, Mark Fowler wrote: > On Wed, 10 Apr 2002, Curt Sampson wrote: > > > > b) Doing proper set comparison (not bags) > > > > This I'm not sure about. You demonstrated some set comparison along > > these lines a while back, did you not? > > eq_set() is reall

Re: Comparing Data Structures Slopply

2002-04-10 Thread Curt Sampson
On Wed, 10 Apr 2002, Nicholas Clark wrote: > The API doesn't define which side is "expected" and which side "got", > does it? I believe it's defined (though perhaps not explicitly) as the first argument being the "got," and the second being the "expected." This is how the error messages print it

Re: Comparing Data Structures Slopply

2002-04-10 Thread Curt Sampson
On Wed, 10 Apr 2002, Michael G Schwern wrote: > Don't fixate on it, write Test module with better set handling. Ah, now I see what people don't understand about the point I was trying to make. Let me try again: that function does not take sets as parameters. It takes arrays, which may or may no

Re: Comparing Data Structures Slopply

2002-04-10 Thread Michael G Schwern
On Thu, Apr 11, 2002 at 09:54:56AM +0900, Curt Sampson wrote: > On Wed, 10 Apr 2002, Nicholas Clark wrote: > > > The API doesn't define which side is "expected" and which side "got", > > does it? > > I believe it's defined (though perhaps not explicitly) as the first > argument being the "got,"

Re: Comparing Data Structures Slopply

2002-04-10 Thread Michael G Schwern
On Thu, Apr 11, 2002 at 10:02:59AM +0900, Curt Sampson wrote: > The whole problem could never have arisen if sets were objects > here, rather than, pretending that an array really is a set. That's > the point I'm trying to make. What must be remembered is these are common testing modules for tes