tests/fn/function-available/_function-available-test-set.xml
author Michael Kay <mike@saxonica.com>
Wed, 01 May 2013 21:35:05 +0100
changeset 194 33b0108ba3f5
child 199 eb590e57670b
permissions -rw-r--r--
Separate function-available tests into their own test-set; add some more tests
<?xml version="1.0" encoding="UTF-8"?>
<test-set xmlns:xs="http://www.w3.org/2001/XMLSchema"
          xmlns="http://www.w3.org/2012/10/xslt-test-catalog"
          name="function-available">
   <description>Tests the function-available() function</description>


   <environment name="function-available-08">
      <source role=".">
         <content><![CDATA[ 
<doc>
<name>substring</name>
<name>floor</name>
<name>bench</name>
<name>ceiling</name>
<name>pineapple</name>
</doc>]]></content>
      </source>
   </environment>

   <environment name="function-available-10">
      <source role=".">
         <content><![CDATA[<doc/>]]></content>
      </source>
   </environment>

   <test-case name="function-available-0204">
      <description>test function-available() on stylesheet function</description>
      <created by="Michael Kay" on="2012-11-07"/>
      <environment ref="function-available-10"/>
      <dependencies>
         <spec value="XSLT20+"/>
      </dependencies>
      <test>
         <stylesheet file="function-available-0204.xsl"/>
      </test>
      <result>
         <assert-xml><![CDATA[<out><true>true</true><false>false</false></out>]]></assert-xml>
      </result>
   </test-case>


   <test-case name="function-available-0801">
      <description>test function-available() called dynamically from an expression evaluated lazily</description>
      <created by="Michael Kay" on="2012-11-07"/>
      <environment ref="function-available-08"/>
      <dependencies>
         <spec value="XSLT20+"/>
      </dependencies>
      <test>
         <stylesheet file="function-available-0801.xsl"/>
      </test>
      <result>
         <assert-xml><![CDATA[<out>substring,floor,ceiling</out>]]></assert-xml>
      </result>
   </test-case>

   <test-case name="function-available-1006">
      <description>test function-available() using the fn:namespace</description>
      <created by="Michael Kay" on="2012-11-07"/>
      <environment ref="function-available-10"/>
      <dependencies>
         <spec value="XSLT10+"/>
      </dependencies>
      <test>
         <stylesheet file="function-available-1006.xsl"/>
      </test>
      <result>
         <assert-xml file="function-available-1006.out"/>
      </result>
   </test-case>

   <test-case name="function-available-1008">
      <description>Test function-available() with two arguments</description>
      <created by="Michael Kay" on="2012-11-07"/>
      <environment ref="function-available-10"/>
      <dependencies>
         <spec value="XSLT20+"/>
      </dependencies>
      <test>
         <stylesheet file="function-available-1008.xsl"/>
      </test>
      <result>
         <assert-xml file="function-available-1008.out"/>
      </result>
   </test-case>

   <test-case name="function-available-1010">
      <description>Test function-available() with dynamic arguments</description>
      <created by="Michael Kay" on="2012-11-07"/>
      <environment ref="function-available-10"/>
      <dependencies>
         <spec value="XSLT20+"/>
      </dependencies>
      <test>
         <stylesheet file="function-available-1010.xsl"/>
      </test>
      <result>
         <assert-xml file="function-available-1010.out"/>
      </result>
   </test-case>

   <test-case name="function-available-1015">
      <description>Test of function-available() on the functions true() and false()</description>
      <created by="Michael Kay" on="2012-11-07"/>
      <environment ref="function-available-10"/>
      <dependencies>
         <spec value="XSLT20+"/>
      </dependencies>
      <test>
         <stylesheet file="function-available-1015.xsl"/>
      </test>
      <result>
         <assert-xml><![CDATA[<out><a>true</a><b>true</b><a>true</a><b>true</b><a>false</a><b>false</b><a>true</a><b>true</b></out>]]></assert-xml>
      </result>
   </test-case>
   
   <test-case name="function-available-1016">
      <description>Test of function-available() on constructor functions for abstract types</description>
      <created by="Michael Kay" on="2012-11-07"/>
      <environment ref="function-available-10"/>
      <dependencies>
         <spec value="XSLT20+"/>
      </dependencies>
      <test>
         <stylesheet file="function-available-1016.xsl"/>
      </test>
      <result>
         <all-of>
           <assert>/out/a = 'false'</assert>
           <assert>/out/b = 'false'</assert>
           <assert>/out/c = 'false'</assert>
           <assert>/out/d = 'false'</assert>
           <assert>/out/e = 'false'</assert>
           <assert>/out/f = 'false'</assert>
         </all-of>  
      </result>
   </test-case>

</test-set>