[SCXML] Incorrect and incomplete test 330 for ecmascript

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[SCXML] Incorrect and incomplete test 330 for ecmascript

Ate Douma
Hi,

While 'cloning' a style sheet to generate scxml tests for a custom language, I
discovered the confEcma.xsl template for "//@conf:eventFieldsAreBound" is
incomplete/incorrect:

   <!-- returns true if all the required fields of _event are bound -->
   <xsl:template match="//@conf:eventFieldsAreBound">
     <xsl:attribute name="cond">'name' in _event &amp;&amp; 'type' in _event
&amp;&amp; 'sendid' in _event &amp;&amp; 'origin' in _event &amp;&amp;
'invokeid' &amp;&amp; 'data' in _event</xsl:attribute>
   </xsl:template>

should be:

   <!-- returns true if all the required fields of _event are bound -->
   <xsl:template match="//@conf:eventFieldsAreBound">
     <xsl:attribute name="cond">'name' in _event &amp;&amp; 'type' in _event
&amp;&amp; 'sendid' in _event &amp;&amp; 'origin' in _event &amp;&amp;
'origintype' in _event &amp;&amp; 'invokeid' in _event &amp;&amp; 'data' in
_event</xsl:attribute>
   </xsl:template>

The above template is (only) used in test 330.

For the record, the same template in confXpath.xsl is correct.

Regards, Ate

Reply | Threaded
Open this post in threaded view
|

Re: [SCXML] Incorrect and incomplete test 330 for ecmascript

Zjnue Brzavi
Hi,
 
should be:

  <!-- returns true if all the required fields of _event are bound -->
  <xsl:template match="//@conf:eventFieldsAreBound">
    <xsl:attribute name="cond">'name' in _event &amp;&amp; 'type' in _event &amp;&amp; 'sendid' in _event &amp;&amp; 'origin' in _event &amp;&amp; 'origintype' in _event &amp;&amp; 'invokeid' in _event &amp;&amp; 'data' in _event</xsl:attribute>
  </xsl:template>

Forgot to report this one to the list.
Reply | Threaded
Open this post in threaded view
|

Re: [SCXML] Incorrect and incomplete test 330 for ecmascript

Ate Douma
On 2015-02-12 08:46, Zjnue Brzavi wrote:

> Hi,
>
>     should be:
>
>        <!-- returns true if all the required fields of _event are bound -->
>        <xsl:template match="//@conf:__eventFieldsAreBound">
>          <xsl:attribute name="cond">'name' in _event &amp;&amp; 'type' in _event
>     &amp;&amp; 'sendid' in _event &amp;&amp; 'origin' in _event &amp;&amp;
>     'origintype' in _event &amp;&amp; 'invokeid' in _event &amp;&amp; 'data' in
>     _event</xsl:attribute>
>        </xsl:template>
>
>
> Confirmed here:
> https://github.com/zjnue/hscxml/blob/master/test/files/w3c/scxml-irp/confEcma.xsl#L515

Note that your version isn't yet checking for 'origintype' either.

>
> Forgot to report this one to the list.


Reply | Threaded
Open this post in threaded view
|

Re: [SCXML] Incorrect and incomplete test 330 for ecmascript

Zjnue Brzavi
 
Confirmed here:
https://github.com/zjnue/hscxml/blob/master/test/files/w3c/scxml-irp/confEcma.xsl#L515

Note that your version isn't yet checking for 'origintype' either.

Good point thanks, fixed! Mine only had 'invokeid' corrected to 'invokeid' in _event.
Reply | Threaded
Open this post in threaded view
|

Re: [SCXML] Incorrect and incomplete test 330 for ecmascript

Jim Barnett
In reply to this post by Ate Douma
I've updated confECMA.xsl.

- Jim
On 2/11/2015 5:17 PM, Ate Douma wrote:

> Hi,
>
> While 'cloning' a style sheet to generate scxml tests for a custom
> language, I discovered the confEcma.xsl template for
> "//@conf:eventFieldsAreBound" is incomplete/incorrect:
>
>   <!-- returns true if all the required fields of _event are bound -->
>   <xsl:template match="//@conf:eventFieldsAreBound">
>     <xsl:attribute name="cond">'name' in _event &amp;&amp; 'type' in
> _event &amp;&amp; 'sendid' in _event &amp;&amp; 'origin' in _event
> &amp;&amp; 'invokeid' &amp;&amp; 'data' in _event</xsl:attribute>
>   </xsl:template>
>
> should be:
>
>   <!-- returns true if all the required fields of _event are bound -->
>   <xsl:template match="//@conf:eventFieldsAreBound">
>     <xsl:attribute name="cond">'name' in _event &amp;&amp; 'type' in
> _event &amp;&amp; 'sendid' in _event &amp;&amp; 'origin' in _event
> &amp;&amp; 'origintype' in _event &amp;&amp; 'invokeid' in _event
> &amp;&amp; 'data' in _event</xsl:attribute>
>   </xsl:template>
>
> The above template is (only) used in test 330.
>
> For the record, the same template in confXpath.xsl is correct.
>
> Regards, Ate
>