<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="HigherOrderFunctions2" featureOwner="Michael Kay">

    <GroupInfo>
        <title>Head and Tail Functions</title>
        <description>Test cases for head() and tail() functions in XQuery 1.1</description>
    </GroupInfo>

    <test-case is-XPath2="false" name="head-001" FilePath="Functions/SeqFunc/HeadTailFunc/" scenario="standard" Creator="Michael Kay">
        <description>head() of a simple sequence</description>
        <spec-citation spec="FuncOps" section-number="__HEADSEC" section-title="fn:head" section-pointer="__HEAD"/>
        <query name="head-001" date="2010-02-18"/>
        <output-file spec-version="1.1" role="principal" compare="XML">head-001.out</output-file>
        <expected-error spec-version="1.0">XQST0031</expected-error>
    </test-case>
    
    <test-case is-XPath2="false" name="head-002" FilePath="Functions/SeqFunc/HeadTailFunc/" scenario="standard" Creator="Michael Kay">
        <description>head() of a simple sequence</description>
        <spec-citation spec="FuncOps" section-number="__HEADSEC" section-title="fn:head" section-pointer="__HEAD"/>
        <query name="head-002" date="2010-02-18"/>
        <output-file spec-version="1.1" role="principal" compare="XML">head-002.out</output-file>
        <expected-error spec-version="1.0">XQST0031</expected-error>
    </test-case>
    
    <test-case is-XPath2="false" name="head-003" FilePath="Functions/SeqFunc/HeadTailFunc/" scenario="standard" Creator="Michael Kay">
        <description>head() of a node sequence</description>
        <spec-citation spec="FuncOps" section-number="__HEADSEC" section-title="fn:head" section-pointer="__HEAD"/>
        <query name="head-003" date="2010-02-18"/>
        <output-file spec-version="1.1" role="principal" compare="XML">head-003.out</output-file>
        <expected-error spec-version="1.0">XQST0031</expected-error>
    </test-case>
    
    <test-case is-XPath2="false" name="head-004" FilePath="Functions/SeqFunc/HeadTailFunc/" scenario="standard" Creator="Michael Kay">
        <description>head() of a singleton sequence</description>
        <spec-citation spec="FuncOps" section-number="__HEADSEC" section-title="fn:head" section-pointer="__HEAD"/>
        <query name="head-004" date="2010-02-18"/>
        <output-file spec-version="1.1" role="principal" compare="XML">head-004.out</output-file>
        <expected-error spec-version="1.0">XQST0031</expected-error>
    </test-case>
    
    <test-case is-XPath2="false" name="head-005" FilePath="Functions/SeqFunc/HeadTailFunc/" scenario="standard" Creator="Michael Kay">
        <description>head() of an empty sequence</description>
        <spec-citation spec="FuncOps" section-number="__HEADSEC" section-title="fn:head" section-pointer="__HEAD"/>
        <query name="head-005" date="2010-02-18"/>
        <output-file spec-version="1.1" role="principal" compare="XML">head-005.out</output-file>
        <expected-error spec-version="1.0">XQST0031</expected-error>
    </test-case>
    
    <test-case is-XPath2="false" name="head-006" FilePath="Functions/SeqFunc/HeadTailFunc/" scenario="standard" Creator="Michael Kay">
        <description>head() preserves identity</description>
        <spec-citation spec="FuncOps" section-number="__HEADSEC" section-title="fn:head" section-pointer="__HEAD"/>
        <query name="head-006" date="2010-02-18"/>
        <output-file spec-version="1.1" role="principal" compare="XML">head-006.out</output-file>
        <expected-error spec-version="1.0">XQST0031</expected-error>
    </test-case>
    
    <test-case is-XPath2="false" name="tail-001" FilePath="Functions/SeqFunc/HeadTailFunc/" scenario="standard" Creator="Michael Kay">
        <description>tail() of a simple sequence</description>
        <spec-citation spec="FuncOps" section-number="__TAILSEC" section-title="fn:tail" section-pointer="__TAIL"/>
        <query name="tail-001" date="2010-02-18"/>
        <output-file spec-version="1.1" role="principal" compare="XML">tail-001.out</output-file>
        <expected-error spec-version="1.0">XQST0031</expected-error>
    </test-case>
    
    <test-case is-XPath2="false" name="tail-002" FilePath="Functions/SeqFunc/HeadTailFunc/" scenario="standard" Creator="Michael Kay">
        <description>tail() of a simple sequence</description>
        <spec-citation spec="FuncOps" section-number="__TAILSEC" section-title="fn:tail" section-pointer="__TAIL"/>
        <query name="tail-002" date="2010-02-18"/>
        <output-file spec-version="1.1" role="principal" compare="XML">tail-002.out</output-file>
        <expected-error spec-version="1.0">XQST0031</expected-error>
    </test-case>
    
    <test-case is-XPath2="false" name="tail-003" FilePath="Functions/SeqFunc/HeadTailFunc/" scenario="standard" Creator="Michael Kay">
        <description>tail() of a singleton sequence</description>
        <spec-citation spec="FuncOps" section-number="__TAILSEC" section-title="fn:tail" section-pointer="__TAIL"/>
        <query name="tail-003" date="2010-02-18"/>
        <output-file spec-version="1.1" role="principal" compare="XML">tail-003.out</output-file>
        <expected-error spec-version="1.0">XQST0031</expected-error>
    </test-case>
    
    <test-case is-XPath2="false" name="tail-004" FilePath="Functions/SeqFunc/HeadTailFunc/" scenario="standard" Creator="Michael Kay">
        <description>tail() of an empty sequence</description>
        <spec-citation spec="FuncOps" section-number="__TAILSEC" section-title="fn:tail" section-pointer="__TAIL"/>
        <query name="tail-004" date="2010-02-18"/>
        <output-file spec-version="1.1" role="principal" compare="XML">tail-004.out</output-file>
        <expected-error spec-version="1.0">XQST0031</expected-error>
    </test-case>
    
    <test-case is-XPath2="false" name="tail-005" FilePath="Functions/SeqFunc/HeadTailFunc/" scenario="standard" Creator="Michael Kay">
        <description>tail() of a node sequence</description>
        <spec-citation spec="FuncOps" section-number="__TAILSEC" section-title="fn:tail" section-pointer="__TAIL"/>
        <query name="tail-005" date="2010-02-18"/>
        <output-file spec-version="1.1" role="principal" compare="XML">tail-005.out</output-file>
        <expected-error spec-version="1.0">XQST0031</expected-error>
    </test-case>
    
    <test-case is-XPath2="false" name="tail-006" FilePath="Functions/SeqFunc/HeadTailFunc/" scenario="standard" Creator="Michael Kay">
        <description>head-tail recursion using head() and tail()</description>
        <spec-citation spec="FuncOps" section-number="__TAILSEC" section-title="fn:tail" section-pointer="__TAIL"/>
        <query name="tail-006" date="2010-02-18"/>
        <output-file spec-version="1.1" role="principal" compare="XML">tail-006.out</output-file>
        <expected-error spec-version="1.0">XQST0031</expected-error>
    </test-case>
    
</test-group>
