Package tests added (todo: need to check)
authorabraaksm
Thu, 29 Oct 2015 15:02:23 +0100
changeset 1203 73afeb87fe97
parent 1202 8215c06f7661
child 1204 fa1021d266c8
Package tests added (todo: need to check)
tests/decl/package/_package-test-set.xml
tests/decl/package/package-017.xsl
tests/decl/package/package-018.xsl
tests/decl/package/package-019-include.xsl
tests/decl/package/package-019-used.xsl
tests/decl/package/package-019.xsl
tests/decl/package/package-020-import.xsl
tests/decl/package/package-020-used.xsl
tests/decl/package/package-020.xsl
tests/decl/package/package-020a.xsl
tests/decl/package/package-020b.xsl
tests/insn/sort/_sort-test-set.xml
--- a/tests/decl/package/_package-test-set.xml	Thu Jan 14 17:53:54 2016 +0100
+++ b/tests/decl/package/_package-test-set.xml	Thu Oct 29 15:02:23 2015 +0100
@@ -322,6 +322,102 @@
       </result>
    </test-case>
    
+   <test-case name="package-019">
+      <description>Using xsl:include to include xsl:use-package definitions in another package</description>
+      <created by="Abel Braaksma" on="2015-10-22"/>
+      <environment>
+         <source file="package-000.xml" uri="package-000.xml" role="."/>
+      </environment>
+      <test>
+         <package file="package-019.xsl" role="principal"/>
+         <package file="package-019-used.xsl" uri="urn:use-me" package-version="0.1"  role="secondary"/>
+         <stylesheet file="package-019-include.xsl" role="secondary"/>
+      </test>
+      <result>
+         <assert-string-value>You found me!</assert-string-value>
+      </result>
+   </test-case>
+   
+   <test-case name="package-020">
+      <description>Using xsl:import to import xsl:use-package definitions in another package</description>
+      <created by="Abel Braaksma" on="2015-10-22"/>
+      <environment>
+         <source file="package-000.xml" uri="package-000.xml" role="."/>
+      </environment>
+      <test>
+         <package file="package-020.xsl" role="principal"/>
+         <package file="package-020-used.xsl" uri="urn:use-me" package-version="0.1"  role="secondary"/>
+         <stylesheet file="package-020-import.xsl" role="secondary"/>
+      </test>
+      <result>
+         <assert-string-value>You found me!</assert-string-value>
+      </result>
+   </test-case>
+   
+   <test-case name="package-020a">
+      <description>Using xsl:import to import xsl:use-package definitions in another package, override a component that uses a component of a package</description>
+      <created by="Abel Braaksma" on="2015-10-22"/>
+      <environment>
+         <source file="package-000.xml" uri="package-000.xml" role="."/>
+      </environment>
+      <test>
+         <package file="package-020a.xsl" role="principal"/>
+         <package file="package-020-used.xsl" uri="urn:use-me" package-version="0.1"  role="secondary"/>
+         <stylesheet file="package-020-import.xsl" role="secondary"/>
+      </test>
+      <result>
+         <assert-string-value>You found me!</assert-string-value>
+      </result>
+   </test-case>
+   
+   <test-case name="package-020b">
+      <description>Using xsl:import to import xsl:use-package definitions in another package, override a component and use a component of the imported use-package</description>
+      <created by="Abel Braaksma" on="2015-10-22"/>
+      <environment>
+         <source file="package-000.xml" uri="package-000.xml" role="."/>
+      </environment>
+      <test>
+         <package file="package-020b.xsl" role="principal"/>
+         <package file="package-020-used.xsl" uri="urn:use-me" package-version="0.1"  role="secondary"/>
+         <stylesheet file="package-020-import.xsl" role="secondary"/>
+      </test>
+      <result>
+         <assert-string-value>You found me!</assert-string-value>
+      </result>
+   </test-case>
+   
+   <test-case name="package-020c">
+      <description>Using xsl:import to import xsl:use-package definitions in another package</description>
+      <created by="Abel Braaksma" on="2015-10-22"/>
+      <environment>
+         <source file="package-000.xml" uri="package-000.xml" role="."/>
+      </environment>
+      <test>
+         <package file="package-020c.xsl" role="principal"/>
+         <package file="package-020-used.xsl" uri="urn:use-me" package-version="0.1"  role="secondary"/>
+         <stylesheet file="package-020-import.xsl" role="secondary"/>
+      </test>
+      <result>
+         <assert-string-value>You found me!</assert-string-value>
+      </result>
+   </test-case>
+   
+   <test-case name="package-020d">
+      <description>Using xsl:import to import xsl:use-package definitions in another package</description>
+      <created by="Abel Braaksma" on="2015-10-22"/>
+      <environment>
+         <source file="package-000.xml" uri="package-000.xml" role="."/>
+      </environment>
+      <test>
+         <package file="package-020a.xsl" role="principal"/>
+         <package file="package-020-used.xsl" uri="urn:use-me" package-version="0.1"  role="secondary"/>
+         <stylesheet file="package-020-import.xsl" role="secondary"/>
+      </test>
+      <result>
+         <assert-string-value>You found me!</assert-string-value>
+      </result>
+   </test-case>
+   
    <test-case name="package-100">
       <description>CSV package from the spec, section 3.5.7.2</description>
       <created by="Abel Braaksma" on="2015-10-01"/>
--- a/tests/decl/package/package-017.xsl	Thu Jan 14 17:53:54 2016 +0100
+++ b/tests/decl/package/package-017.xsl	Thu Oct 29 15:02:23 2015 +0100
@@ -10,10 +10,12 @@
     <!-- testing using a pkg (twice), the used pkg contains two functions which do nothing -->    
     <xsl:use-package name="urn:use-me" package-version="*"  >
         <xsl:accept component="function" names="pkg:function1" visibility="public" />
+        <xsl:accept component="function" names="*" visibility="hidden" />
     </xsl:use-package>
     
     <xsl:use-package name="urn:use-me" package-version="0.1"  >
-        <xsl:accept component="function" names="pkg:function2" visibility="public" />        
+        <xsl:accept component="function" names="pkg:function2" visibility="public" />
+        <xsl:accept component="function" names="*" visibility="hidden" />
     </xsl:use-package>
     
     <!-- an (almost) empty package -->
--- a/tests/decl/package/package-018.xsl	Thu Jan 14 17:53:54 2016 +0100
+++ b/tests/decl/package/package-018.xsl	Thu Oct 29 15:02:23 2015 +0100
@@ -14,7 +14,8 @@
     </xsl:use-package>
     
     <xsl:use-package name="urn:use-me" package-version="0.1">        
-        <xsl:accept component="function" names="pkg:function2" visibility="public" />        
+        <xsl:accept component="function" names="pkg:function2" visibility="public" />
+        <xsl:accept component="function" names="pkg:function1" visibility="hidden" />
     </xsl:use-package>
     
     <!-- an (almost) empty package -->
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/package/package-019-include.xsl	Thu Oct 29 15:02:23 2015 +0100
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pkg="urn:use-me"
+    version="3.0">
+    
+    <!-- testing using a pkg (twice), the used pkg contains two functions which do nothing -->    
+    <xsl:use-package name="urn:use-me" package-version="*"  >
+        <xsl:accept component="function" names="pkg:function1" visibility="public" />
+    </xsl:use-package>
+    
+    <xsl:template match="second-child">
+        <xsl:value-of select="pkg:function1()" />
+    </xsl:template>
+    
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/package/package-019-used.xsl	Thu Oct 29 15:02:23 2015 +0100
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package
+    package-version="0.1"
+    name="urn:use-me"
+    xmlns:me="urn:use-me"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    version="3.0">
+    
+    <!-- private to a package -->
+    <xsl:mode on-no-match="fail" />
+    
+    <xsl:function name="me:function1" visibility="public" >You found me!</xsl:function>
+    <xsl:function name="me:function2" visibility="public" />
+    
+</xsl:package>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/package/package-019.xsl	Thu Oct 29 15:02:23 2015 +0100
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package
+    package-version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pkg="urn:use-me"
+    version="3.0">
+    
+    <xsl:mode on-no-match="text-only-copy" />
+    
+    <!-- testing using a pkg through an include -->    
+    <xsl:include href="package-019-include.xsl"/>
+    
+    <!-- an (almost) empty package -->
+    
+</xsl:package>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/package/package-020-import.xsl	Thu Oct 29 15:02:23 2015 +0100
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pkg="urn:use-me"
+    version="3.0">
+    
+    <!-- testing using a pkg (twice), the used pkg contains two functions which do nothing -->    
+    <xsl:use-package name="urn:use-me" package-version="*"  >
+        <xsl:accept component="function" names="pkg:function1" visibility="public" />
+    </xsl:use-package>
+    
+    <xsl:template match="second-child">
+        <xsl:value-of select="'test'" />
+    </xsl:template>
+    
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/package/package-020-used.xsl	Thu Oct 29 15:02:23 2015 +0100
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package
+    package-version="0.1"
+    name="urn:use-me"
+    xmlns:me="urn:use-me"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    version="3.0">
+    
+    <!-- private to a package -->
+    <xsl:mode on-no-match="fail" />
+    
+    <xsl:function name="me:function1" visibility="public" >You found me!</xsl:function>
+    <xsl:function name="me:function2" visibility="public" />
+    
+</xsl:package>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/package/package-020.xsl	Thu Oct 29 15:02:23 2015 +0100
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package
+    package-version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pkg="urn:use-me"
+    version="3.0">
+    
+    <xsl:mode on-no-match="text-only-copy" />
+    
+    <!-- testing using a pkg through an include -->    
+    <xsl:import href="package-020-import.xsl"/>
+    
+    <!-- an (almost) empty package -->
+    
+</xsl:package>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/package/package-020a.xsl	Thu Oct 29 15:02:23 2015 +0100
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package
+    package-version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pkg="urn:use-me"
+    version="3.0">
+    
+    <xsl:mode on-no-match="text-only-copy" />
+    
+    <!-- testing using a pkg through an include -->    
+    <xsl:import href="package-020-import.xsl"/>
+    
+    <!-- use normal import precedence to override -->
+    <xsl:template match="second-child">Higher import precedence</xsl:template>
+    
+</xsl:package>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/package/package-020b.xsl	Thu Oct 29 15:02:23 2015 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package
+    package-version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pkg="urn:use-me"
+    version="3.0">
+    
+    <xsl:mode on-no-match="text-only-copy" />
+    
+    <!-- testing using a pkg through an include -->    
+    <xsl:import href="package-020-import.xsl"/>
+    
+    <!-- use normal import precedence to override -->
+    <xsl:template match="second-child" expand-text="yes">{
+        pkg:function1(), pkg:function1()
+    }</xsl:template>
+    
+</xsl:package>
\ No newline at end of file
--- a/tests/insn/sort/_sort-test-set.xml	Thu Jan 14 17:53:54 2016 +0100
+++ b/tests/insn/sort/_sort-test-set.xml	Thu Oct 29 15:02:23 2015 +0100
@@ -89,6 +89,21 @@
       </source>
    </environment>
    
+   <test-case name="sort-0001">
+      <description>A test with a large input of strings</description>
+      <created by="Abel Braaksma" on="2015-10-07"/>
+      <dependencies>
+         <spec value="XSLT30+"/>
+      </dependencies>
+      <test>
+         <stylesheet file="sort-0001.xsl"/>
+      </test>
+      <result>
+         <assert-xml file="sort-0001.out"/>
+      </result>
+   </test-case>
+
+   
    <test-case name="sort-001">
       <description>A test for xsl:sort with numeric keys</description>
       <created by="Michael Kay" on="2012-11-07"/>