Correct expected results and prevent rounding randomness
authorMichael Kay <mike@saxonica.com>
Wed, 01 Jul 2015 22:02:55 +0100
changeset 1003 0bf0d49fc36e
parent 1002 b5482664b7cd
child 1004 d5ec1b9d8ad5
Correct expected results and prevent rounding randomness
tests/strm/sx-ForExpr/_sx-ForExpr-test-set.xml
tests/strm/sx-ForExpr/sx-for-A.xsl
--- a/tests/strm/sx-ForExpr/_sx-ForExpr-test-set.xml	Wed Jul 01 22:02:03 2015 +0100
+++ b/tests/strm/sx-ForExpr/_sx-ForExpr-test-set.xml	Wed Jul 01 22:02:55 2015 +0100
@@ -50,12 +50,13 @@
    <test-case name="sx-for-004">
       <description>Streaming for expression - "in" expression is grounded and consuming</description>
       <created by="Michael Kay" on="2015-03-27"/>
+      <modified by="Michael Kay" on="2015-07-01" change="correct expected results"/>
       <environment ref="sx-for-A"/>
       <test>
          <initial-template name="r-004"/>
       </test>
       <result>
-        <assert-xml><![CDATA[<out>26.1 25 22.8 24.9 57 24.7</out>]]></assert-xml>
+        <assert-xml><![CDATA[<out>19.1 18 15.8 17.9 48 17.7</out>]]></assert-xml>
       </result>
    </test-case>
    
--- a/tests/strm/sx-ForExpr/sx-for-A.xsl	Wed Jul 01 22:02:03 2015 +0100
+++ b/tests/strm/sx-ForExpr/sx-for-A.xsl	Wed Jul 01 22:02:55 2015 +0100
@@ -39,7 +39,7 @@
         <out>
           <xsl:value-of select="
             for $x in /BOOKLIST/BOOKS/ITEM/DIMENSIONS/snapshot() 
-            return sum(tokenize($x, ' ')!number()) + count($x/ancestor::node())"/>
+            return sum(tokenize($x, ' ')!xs:decimal(.)) + count($x/ancestor::node())"/>
         </out>
       </xsl:stream>
     </xsl:template>