|
From: erixtekila <eri...@gm...> - 2006-04-10 09:04:54
|
> var result:Array=String("ex,why,zed").split(",");
> var expected:Array=["ex","why","zed"];
> assertEquals("csv split of 'ex,why,zed'",result,expected);
>
> It is natural to expect this test to pass, but it fails because
> assertEquals uses === for arrays, which is an identity test in
> actionscript/javascript.
>
> assertSame() is for identity tests, whereas assertEquals() is for
> same-value tests.
Ah, yes.
I was feeling that this problem has already been fixed.
Let me remember, in the time of the as2 only trunk, the solution was to
give AssertSame a way to compare two complex objects.
So the idea was to use an IComparator interface that declare an "equal"
method.
Something along the line of Java.
If one wants to use AssertSame on two complex objects, he can use that
equal method to build comparison logic.
BTW, I feel that this solution was not adopted by asunit team,
eventhough I find it really elegant.
I did it, for my side.
So, in order to vote, I vote on #a.
Backward compatibility is not mandatory when functionnality is not
working.
Cheers
-----------
erixtekila
http://blog.v-i-a.net/
|