W3C home > Mailing lists > Public > www-dom-ts@w3.org > October 2001

Assertion id's

From: Arnold, Curt <Curt.Arnold@hyprotech.com>
Date: Wed, 24 Oct 2001 10:49:23 -0600
Message-ID: <70E215722F6AD511820A000103D141D40AA621@thor.aeathtl.com>
To: "'www-dom-ts@w3.org'" <www-dom-ts@w3.org>
In a previous message, I suggested that the id attributes for <assertDOMException> should be something like id="throw_INDEX_SIZE_ERR", the motivation behind this was that exception assertions are use
xUnit's fail() method and the id is passed as a description.  Since unlike assertEquals, there is no additional information in a failure report, so having an id that clearly indicates the nature of
the failure is very helpful when reviewing the test failures.

I believe that I had also suggested that assertEquals, assertNull, et al have shorter names, typically the name of the variable being checked.  All that is necessary of the assertion id is that it be
unique in the document so that we can identify which assertion failed and if it can help in the superficial interpretation of a failure, the better.

The test just posted had this assertion:

<assertNull actual="localName" id="throw_Null"/>

"throw_Null" is not helpful, actually it could be misleading.  Since it is an assertNull, the test output will already indicate that something that was supposed to be null wasn't.  And nothing is
being thrown.

In this case, I would suggest an id="localName" which would result in something approximately:

Traceback: localName: expected null was ....

Again, I wouldn't hold up a commit to change these, but I did want to point this out.
Received on Wednesday, 24 October 2001 12:55:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 6 April 2009 12:58:45 GMT