Actually, this was a debate we had before with Hani and Adrian.
The test is correct for what the method is supposed to do.
There are two methods: - collectUnion: should allow several equal elements. This is useful especially in combination with groupedBy: because you can count how many things are there that are the same. - collectAsSet: should not allow several equal elements.
The name of the collectUnion: method is probably confusing because union: returns a unique set of elements. So, maybe we should rename collectAsSet: to collectUnion: and collectUnion: to something like collectConcatenated: (although I do not like this name either).
Cheers, Doru
On Jun 14, 2008, at 3:55 PM, stéphane ducasse wrote:
I would like to fix collectUnion:
and I would like to understand why
(#((1 2) (3 4) (5 3)) collectUnion: [ :each ]) equalsTo: #(1 2 3 3 4 5))
and not to #(1 2 3 4 5)
is it a bug in the test? Stef _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com www.tudorgirba.com/blog
"Next time you see your life passing by, say 'hi' and get to know her."