|
From: Peter H. <pet...@gm...> - 2006-03-25 19:23:32
|
assertEquals should probably be extended to handle a few extra types (for
ex, Array and XML). assertSame tests if the two arguments are the same
object, while assertEquals is more concerned with the value.
Peter
On 3/25/06, Robert Penner <in...@ro...> wrote:
>
> > assertEquals uses =3D=3D=3D. What kind of difference it is seeing?!
>
> You have two different arrays; they aren't the same object, so =3D=3D or =
=3D=3D=3D
> will be false. AsUnit lets you define an equals() method to compare
> equality
> of objects.
>
> Robert
>
>
> -----Original Message-----
> From: asu...@li...
> [mailto:asu...@li...]On Behalf Of Darren
> Cook
> Sent: March 24, 2006 7:16 PM
> To: asu...@li...
> Subject: Re: [Asunit-users] Verbose assertEquals
>
>
>
> > How about an assertEqualsVerbose function that when it has a failure it
> > appends result and expected to the msg. ...
>
> I've done this, using the latest svn. Can I have svn write access (my SF
> username is darrencook)? Or let me know who I should send files to.
>
> I'm still having a problem using assertEquals with arrays. See the
> function [1] below. The first assert fails with:
> csv split of 'ex,why,zed' expected:<ex,why,zed> but was:<ex,why,zed>
>
> The other, more specific, tests all pass.
>
> assertEquals uses =3D=3D=3D. What kind of difference it is seeing?!
>
> Darren
>
>
> [1]
> public function testSplits(){
> var result:Array=3DString("ex,why,zed").split(",");
> var expected:Array=3D["ex","why","zed"];
> assertEquals("csv split of 'ex,why,zed'",result,expected);
> assertEquals("csv split of 'ex,why,zed':types",typeof result,typeof
> expected);
> assertEquals("csv split of
> 'ex,why,zed':lengths",result.length,expected.length);
> assertEquals("csv split of 'ex,why,zed':[0]",result[0],expected[0]);
> assertEquals("csv split of 'ex,why,zed':[1]",result[1],expected[1]);
> assertEquals("csv split of 'ex,why,zed':[2]",result[2],expected[2]);
> }
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat=
=3D121642
> _______________________________________________
> Asunit-users mailing list
> Asu...@li...
> https://lists.sourceforge.net/lists/listinfo/asunit-users
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat=
=3D121642
> _______________________________________________
> Asunit-users mailing list
> Asu...@li...
> https://lists.sourceforge.net/lists/listinfo/asunit-users
>
|