Add item-separator test cases; also (test 1138) xsl:message does not set temporary output state
authorMichael Kay <mike@saxonica.com>
Tue, 04 Sep 2018 17:31:26 +0100
changeset 1886 5101619186ad
parent 1885 c95de77a4228
child 1888 ce6297d36371
child 1891 13bd2061eeae
Add item-separator test cases; also (test 1138) xsl:message does not set temporary output state
tests/decl/output/_output-test-set.xml
tests/decl/output/output-0718.xsl
tests/decl/output/output-0719.xsl
tests/insn/result-document/_result-document-test-set.xml
tests/insn/result-document/result-document-1410.xsl
--- a/tests/decl/output/_output-test-set.xml	Mon Sep 03 00:05:16 2018 +0100
+++ b/tests/decl/output/_output-test-set.xml	Tue Sep 04 17:31:26 2018 +0100
@@ -4401,5 +4401,39 @@
       </result>
    </test-case>
    
+   <test-case name="output-0718">
+      <description>Serialization with item-separator set to whitespace. method=text, build-tree=yes, atomic values</description>
+      <created by="Michael Kay" on="2018-09-04"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="output-0718.xsl"/>
+         <output serialize="yes"/>
+      </test>
+      <result>
+         <all-of>
+            <serialization-matches>^11   12   13   14   15   16   17   18   19   20$</serialization-matches>          
+         </all-of>
+      </result>
+   </test-case>
+   
+   <test-case name="output-0719">
+      <description>Serialization with item-separator set to newline. method=text, build-tree=yes, atomic values</description>
+      <created by="Michael Kay" on="2018-09-04"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="output-0719.xsl"/>
+         <output serialize="yes"/>
+      </test>
+      <result>
+         <all-of>
+            <serialization-matches>^11\n12\n13\n14\n15\n16\n17\n18\n19\n20$</serialization-matches>          
+         </all-of>
+      </result>
+   </test-case>
+   
 
 </test-set>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/output/output-0718.xsl	Tue Sep 04 17:31:26 2018 +0100
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+   version="3.0">
+
+   <xsl:output method="text" build-tree="yes" indent="no" item-separator="&#x20;&#x20;&#x20;"/>
+
+   <!-- Purpose: Test serialization with item separator set to whitespace (three spaces) -->
+
+   <xsl:template name="xsl:initial-template">
+      <xsl:sequence select="11 to 20"/>
+   </xsl:template>
+</xsl:transform>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/output/output-0719.xsl	Tue Sep 04 17:31:26 2018 +0100
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+   version="3.0">
+
+   <xsl:output method="text" build-tree="yes" indent="no" item-separator="&#x0a;"/>
+
+   <!-- Purpose: Test serialization with item separator set to whitespace (three spaces) -->
+
+   <xsl:template name="xsl:initial-template">
+      <xsl:sequence select="11 to 20"/>
+   </xsl:template>
+</xsl:transform>
--- a/tests/insn/result-document/_result-document-test-set.xml	Mon Sep 03 00:05:16 2018 +0100
+++ b/tests/insn/result-document/_result-document-test-set.xml	Tue Sep 04 17:31:26 2018 +0100
@@ -2506,6 +2506,7 @@
    <test-case name="result-document-1138">
       <description> xsl:result-document in temporary output state </description>
       <created by="Michael Kay" on="2013-08-09"/>
+      <modified by="Michael Kay" on="2018-09-03" change="xsl:message no longer sets temporary output state. Bug 30283."/>
       <environment ref="result-document-113"/>
       <dependencies>
          <spec value="XSLT30+"/>
@@ -2514,7 +2515,7 @@
          <initial-template name="h"/>
       </test>
       <result>
-         <error code="XTDE1480"/>
+         <assert>/h</assert>
       </result>
    </test-case>
 
@@ -2924,6 +2925,43 @@
       </result>
    </test-case>
    
+   <test-case name="result-document-1409">
+      <description>Serialization with item-separator outputting nodes; separator is a newline</description>
+      <created by="Michael Kay" on="2018-09-03"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+         <feature value="serialization" satisfied="true"/>
+      </dependencies>
+      <test>
+         <stylesheet file="result-document-1408.xsl"/>
+         <param name="twiddle" select="'&#x0A;'"/>
+         <output serialize="yes" tree="no"/>
+      </test>
+      <result>
+         <all-of>
+            <serialization-matches><![CDATA[<!--start-->\n11\n12\n13\n14\n15\n<!--middle-->\n16\n17\n18\n19\n20\n<!--end-->$]]></serialization-matches>          
+         </all-of>
+      </result>
+   </test-case>
+   
+   <test-case name="result-document-1410">
+      <description>Serialization with item-separator outputting nodes; separator is a newline</description>
+      <created by="Michael Kay" on="2018-09-03"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+         <feature value="serialization" satisfied="true"/>
+      </dependencies>
+      <test>
+         <stylesheet file="result-document-1410.xsl"/>
+         <output serialize="yes" tree="no"/>
+      </test>
+      <result>
+         <all-of>
+            <serialization-matches><![CDATA[<!--start-->\n11\n12\n13\n14\n15\n<!--middle-->\n16\n17\n18\n19\n20\n<!--end-->$]]></serialization-matches>          
+         </all-of>
+      </result>
+   </test-case>
+   
    <test-case name="result-document-1501">
       <description>xsl:result-document within xsl:analyze-string</description>
       <created by="Michael Kay" on="2016-12-21"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/insn/result-document/result-document-1410.xsl	Tue Sep 04 17:31:26 2018 +0100
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+   version="3.0">
+
+   <!-- Purpose: Test serialization with item separator, outputting nodes -->
+
+   <xsl:template name="xsl:initial-template">
+      <xsl:result-document method="xml" indent="no" item-separator="&#xa;">
+         <xsl:comment>start</xsl:comment>
+         <xsl:sequence select="11 to 15"/>
+         <xsl:comment>middle</xsl:comment>
+         <xsl:sequence select="16 to 20"/>
+         <xsl:comment>end</xsl:comment>
+      </xsl:result-document>
+   </xsl:template>
+</xsl:transform>