Some fixes on the new static param tests
authorabraaksm
Mon, 30 Mar 2015 18:49:01 +0200
changeset 893 d42d1074b77a
parent 892 4905fc82f254
child 894 0fc26a1f66f4
Some fixes on the new static param tests
tests/attr/static/_static-test-set.xml
tests/attr/static/static-016.xsl
tests/attr/static/static-017.xsl
tests/attr/static/static-018.xsl
tests/attr/static/static-019.xsl
--- a/tests/attr/static/_static-test-set.xml	Mon Mar 30 18:48:02 2015 +0200
+++ b/tests/attr/static/_static-test-set.xml	Mon Mar 30 18:49:01 2015 +0200
@@ -618,9 +618,9 @@
    
    <test-case name="static-016">
       <description>
-         Static param with visibility attribute set correctly to private
+         Static param with visibility attribute set (this was allowed in earlier drafts)
       </description>
-      <keywords>static-variable visibility</keywords>
+      <keywords>static-variable visibility err:XTSE0090</keywords>
       <created by="Abel Braaksma" on="2015-03-10"/>
       <dependencies>
          <spec value="XSLT30+"/>
@@ -630,15 +630,15 @@
          <param name="static-param" static="yes" as="xs:string" select="'Private visibility'" />
       </test>
       <result>
-         <assert-string-value>Private visiblity</assert-string-value>
+         <error code="XTSE0090" />
       </result>
    </test-case>
    
    <test-case name="static-017">
       <description>
-         Static param with visibility attribute set incorrectly to abstract
+         Static param with visibility attribute set to a previously invalid value (this used to raise XTSE0020)
       </description>
-      <keywords>static-variable visibility</keywords>
+      <keywords>static-variable visibility ERR:XTSE0090</keywords>
       <created by="Abel Braaksma" on="2015-03-10"/>
       <dependencies>
          <spec value="XSLT30+"/>
@@ -647,15 +647,15 @@
          <stylesheet file="static-017.xsl"/>
       </test>
       <result>
-         <error code="XTSE0020" />
+         <error code="XTSE0090" />
       </result>
    </test-case>
    
    <test-case name="static-018">
       <description>
-         Static param with visibility attribute set incorrectly to public
+         Static param with invalid value "YES" for the static attribute
       </description>
-      <keywords>static-variable visibility</keywords>
+      <keywords>static-variable err:XTSE0020</keywords>
       <created by="Abel Braaksma" on="2015-03-10"/>
       <dependencies>
          <spec value="XSLT30+"/>
@@ -670,9 +670,9 @@
    
    <test-case name="static-019">
       <description>
-         Static param with visibility attribute set incorrectly to final
+         Static param referencing itself in the use-when attribute, error scenario.
       </description>
-      <keywords>static-variable visibility</keywords>
+      <keywords>static-variable err:XPST0008</keywords>
       <created by="Abel Braaksma" on="2015-03-10"/>
       <dependencies>
          <spec value="XSLT30+"/>
@@ -681,7 +681,7 @@
          <stylesheet file="static-019.xsl"/>
       </test>
       <result>
-         <error code="XTSE0020" />
+         <error code="XPST0008" />
       </result>
    </test-case>
    
--- a/tests/attr/static/static-016.xsl	Mon Mar 30 18:48:02 2015 +0200
+++ b/tests/attr/static/static-016.xsl	Mon Mar 30 18:49:01 2015 +0200
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0">
 
-   <!-- Static param with allowed private visibility -->
+   <!-- Static param with private visibility, previously allowed but changed: attribute must not appear on xsl:param -->
    
-   <xsl:variable name="static-param" static="yes" visibility="private" />
+   <xsl:variable name="static-param" static="yes" select="'visibility not allowed'" visibility="private" />
 
-   <xsl:template name="xsl:initial-template">
+   <xsl:template name="xsl:initial-template" expand-text="yes">
       {$static-param}
    </xsl:template>
    
--- a/tests/attr/static/static-017.xsl	Mon Mar 30 18:48:02 2015 +0200
+++ b/tests/attr/static/static-017.xsl	Mon Mar 30 18:49:01 2015 +0200
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0">
 
-   <!-- Static param with wrong visibility of abstract -->
+   <!-- Static param with previously invalid value for visibility, now attribute is disallowed (other error) -->
    
-   <xsl:param name="static-param" static="yes" select="'abstract'" visibility="abstract" />
+   <xsl:param name="static-param" static="yes" select="'invalid'" visibility="invalid-value" />
 
    <xsl:template name="xsl:initial-template" />
    
--- a/tests/attr/static/static-018.xsl	Mon Mar 30 18:48:02 2015 +0200
+++ b/tests/attr/static/static-018.xsl	Mon Mar 30 18:49:01 2015 +0200
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0">
 
-   <!-- Static param with wrong visibility of public -->
+   <!-- Static param with invalid static attribute -->
    
-   <xsl:param name="static-param" static="yes" select="'public'" visibility="public" />
+   <xsl:param name="static-param" static="YES" select="'public'" />
 
-   <xsl:template name="xsl:initial-template" />
+   <xsl:template name="xsl-initial-template" />
    
 </xsl:transform>
--- a/tests/attr/static/static-019.xsl	Mon Mar 30 18:48:02 2015 +0200
+++ b/tests/attr/static/static-019.xsl	Mon Mar 30 18:49:01 2015 +0200
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0">
 
-   <!-- Static param with wrong visibility of final -->
+   <!-- Static param referring to itself in use-when -->
    
-   <xsl:param name="static-param" static="yes" select="'final'" visibility="final" />
+   <xsl:param name="static-param" static="yes" select="true()" use-when="$static-param" />
 
    <xsl:template name="xsl:initial-template" />