IPR tests, part 1

Yesterday I used Saxon 9.4 to apply the ECMAScript XSL on all tests.

I have added them to my test page (also made some modifications, like allowing a few manual tests to run automatically fixing some errors and incorrect behavior, some of which I reported here), up to test495, and here are some comments.
I have activated a total of 164 tests including 3 that aren't from the W3C. 161 of them pass.

150 and 151 are duplicates; moreover they produce a <data name="Var3">[1, 2, 3]</data>.
According to C.2.1, that should be interpreted as the string "[1, 2, 3]" rather than an actual array. Which is obviously not what the test intends. It should transform into <data name="Var3" expr="[1, 2, 3]" /> instead.

test 307 could be automated with what we said recently about the ECMAScript datamodel:
First it tries to access a declared but unbound variable (because binding=late). According to the spec we must get 'undefined' and no error.
Then it binds the number 1 to that variable and tries to access an undeclared property of that variable. Which returns 'undefined' as well, and no error.

test 344's comments could be improved. It suggets that a non-boolean expression in a 'cond' should raise an error, which is of course absurd in ECMAScript where any value can be converted to boolean. But the test happens to put a value with a syntax error in there so of course there will be an error in that case.

test 351 expects the first sent event to have a sendid, just because the <send> element had an 'id' attribute. My understanding of 3.14 is that an id must be generated for each <send> that doesn't have one, but according to 5.10.1 that id must be included in the event when and only when it is an error event resulting from a failed <send>.

Speaking of which, I do not see the point of having a new sendid or invokeid generated each time a send or invoke element is executed. I can imagine one case where that may be useful for send, to cancel a specific delayed send if you start several with a <foreach>, but then why allow some of them to have fixed IDs with the id attribute? And each <invoke> can only have one simultaneous session running.

test 353 tests event.language, which is completely new to me, and, from what I can see in the test, is supposed to reflect the originating datamodel of the event. I am all for some kind of MIME type and encoding information when an event is send to a remote system, but that's transport stuff and not strictly related to the datamodel.

test 456 seems to expect that undefined+1 == 1. Well, it's not the case. Maybe if you convert undefined to a number first, or initialize the variable to 0 so it's not undefined.

test 457 works, but the comments say more than the test. First, an array can be instanceof some other global's Array object, in which case, annoyingly, it will tell you that it is not instanceof (your own global's) Array.
Second, there is no good reason why any iterable object couldn't be iterable with <foreach>. ECMAScript's for…in construct can iterate over Arrays items, other objects's properties (we should say to iterate only over the object's own properties, since that is what you want to do 99% of the time), and the characters in strings.
In the case of strings, it is unnecessary to make a shallow copy because strings are immutable.

test 488, the transformation left a conf:eventDataVal="" attribute in the first transition in s1.

			David

Received on Monday, 8 April 2013 20:18:15 UTC