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

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: Test::Exception... comments?

2002-04-10 Thread Michael G Schwern
On Thu, Apr 11, 2002 at 10:37:10AM +0900, Curt Sampson wrote: > On Tue, 9 Apr 2002, Michael G Schwern wrote: > > > > I'm not sure exactly what the purpose of this is; your test will > > > still fail if it dies even when not in a lives_ok block, right? > > > > It'll fail and take the whole rest of

Re: Test::Exception... comments?

2002-04-10 Thread Curt Sampson
On Tue, 9 Apr 2002, Michael G Schwern wrote: > > I'm not sure exactly what the purpose of this is; your test will > > still fail if it dies even when not in a lives_ok block, right? > > It'll fail and take the whole rest of the test program with it. Some > testing systems like to abort the test

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 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: Test::Exception... comments?

2002-04-10 Thread Michael G Schwern
On Wed, Apr 10, 2002 at 10:57:09PM +0100, Adrian Howard wrote: > Hmmm... All seems sensible. Patch attached for Builder.pm that adds a > _may_be_regex method. Okay? Except it should be public (if Test::Exception wants to use it) and documented and tested. :) -- Michael G. Schwern <[EMAIL PR

Re: Test::Exception... comments?

2002-04-10 Thread Adrian Howard
Hi, Hmmm... All seems sensible. Patch attached for Builder.pm that adds a _may_be_regex method. Okay? New version of Test::Exception at . Anything else :-) Cheers, Adrian on 10/4/02 4:00 pm, Michael G Schwern at [EMAIL PROTECTED] wrote: > On Wed, Apr 10, 200

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 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 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: Test::Exception... comments?

2002-04-10 Thread Michael G Schwern
On Wed, Apr 10, 2002 at 11:03:27AM +0100, Mark Fowler wrote: > On Tue, 9 Apr 2002, Adrian Howard wrote: > > > Any comments before I throw it at CPAN? Sound vaguely sane? > > throws_ok can take either a class name or a Regexp ref as an argument to > compare against. With earlier versions of per

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 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: Test::Exception... comments?

2002-04-10 Thread Mark Fowler
On Tue, 9 Apr 2002, Adrian Howard wrote: > Any comments before I throw it at CPAN? Sound vaguely sane? throws_ok can take either a class name or a Regexp ref as an argument to compare against. With earlier versions of perl you can't use the qr// operator, so you can't pass regex. Maybe it wo