|
From: erixtekila <eri...@if...> - 2004-12-18 17:27:41
|
Hi, I was looking in assertEquals implementaion and discovered that in fact assertEquals works the same way that assertSame. I think it's not the desired behaviour. In my opinion, When talking of object reference, assertSame should passes when obj1 === obj2. It's a reference test. Nevertheless, assertEquals should test contents, not reference in memory. That way, assertEquals(obj1 , obj2) should passes only if all properties of obj1 has the same value than obj2. Unfortunaly, we don't get a native clone method in AS2, but the test should passes only if : obj2=clone(obj1); assertEquals(obj1, obj2); So we could use a recursive for-in check to validate this method correctly if test is made on object datatype. I think it should be the expected behaviour. Tell me what you think. Cheers |