assertEquals message format -- is this right?

0 views
Skip to first unread message

Indy Nagpal

unread,
May 23, 2008, 2:43:04 AM5/23/08
to mxunit
Hi

When I use asserEquals and it fails, I get a message that shows
something like:

0::[] NOT EQUAL TO [1]::

Wouldn't it be better if it read: ::[0] NOT EQUAL TO [1]::

Indy

PS: Is there a issue tracker where I can log such issues or is the
mailing list the best mechanism?

billy

unread,
May 23, 2008, 6:10:13 AM5/23/08
to mxunit
Thanks, Indy! Yeah I saw noticed this a day or two before webmaniacs
and put it off ... Anyway, it's been fixed and in the repo.

I posted the issue and comments this morning, but please feel free to
use the issue tracker in the future: http://code.google.com/p/mxunit/issues/list.
You may also want to post it here on the list so that we all get a
notification.

Here are the details:

-------------------------

Bug Test: >>>>>>>>>>>>>>>>>>>>>

<cffunction
name="testThatAssertEqualsFailureMessageIsMessageActualExpected">
<cfscript>
try{
assertEquals(1,2, "my message");
}
catch(any e){
actual = e.getMessage();
}
expected = "my message::[1] NOT EQUAL TO [2]";
debug(expected);
debug(actual);
assertEquals(expected, actual, "Failure message outputs should be
the same");
</cfscript>
</cffunction>


Resolution: >>>>>>>>>>>>>>>>>>>

assertEquals() calls failNotEquals() but the parameters were out of
order in that call and, of course, there was no test for the output
format. So, the call to failNotEquals() was changed from

failNotEquals(arguments.message, expectedStringValue,
actualStringValue );

TO

failNotEquals(expectedStringValue, actualStringValue,
arguments.message);

//Notes, good little lesson!
-------------------------


bill[y]
Reply all
Reply to author
Forward
0 new messages