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 of a smartass, and it came
out sounding a bit too serious on the list. (Assuming I'm interpreting
this correctly, of course.) I quite agree with what I percieve to
be his point, which is that the name sucks.

However, the test itself is a great idea. Just the other day I
found myself writing a method that, given an array, returns a
reference to a sorted version of that array. This was just so I
didn't have to worry about the order of things within a set-type
object I was testing.

>  a) Treating lists as hashes (i.e. they can be reordered at will but
>     elements must be paired)

Also an excellent idea.

>  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?

    set_equals(\["one", "two"], \["one", "two", "two"]);

(Sorry, I don't recall the method name right off-hand now.) You
pointed out that it fails, and that you felt it's actually doing
a bag comparison. Well, my opinion of the matter is that it *ought*
to fail, because that second parameter is not a set. Sets can't
have multiple instances of a particular value in them. If I iterate
over a set using the common idiom for the language and data structure,
I should never get multiple instances of the same value back.

I think the problem in this case is not that the test method you
want doesn't exist, but that you want to be using some sort of Set
object and you're trying to use an array instead.

cjs
-- 
Curt Sampson  <[EMAIL PROTECTED]>   +81 90 7737 2974   http://www.netbsd.org
    Don't you know, in this new Dark Age, we're all light.  --XTC

Reply via email to