<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/cache-006.xml"
        name="cache-006.xml"
        expected="fail"
        code="cxerr:XI0038">
   <t:info xmlns:cxerr="http://xmlcalabash.com/ns/error">
      <t:title>cache-006</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2026-05-10</t:date>
            <t:author>
               <t:name>Norm Tovey-Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Fixed title.</p>
            </t:description>
         </t:revision>
         <t:revision>
            <t:date>2024-11-29</t:date>
            <t:author>
               <t:name>Norm Tovey-Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Created test.</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml"
                  xmlns:cxerr="http://xmlcalabash.com/ns/error">
      <p>Tests that the document can be removed from the cache.</p>
   </t:description>
   <t:pipeline xmlns:cxerr="http://xmlcalabash.com/ns/error">
      <p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
                      xmlns:err="http://www.w3.org/ns/xproc-error"
                      xmlns:p="http://www.w3.org/ns/xproc"
                      version="3.0">
         <p:import href="https://xmlcalabash.com/ext/library/cache.xpl"/>
         <p:output port="result"/>
         <cx:cache-delete name="cache-delete"
                          fail-if-not-in-cache="true"
                          href="https://xmlcalabash.com/does/not/exist.xml">
            <p:with-input>
               <irrelevant/>
            </p:with-input>
         </cx:cache-delete>
         <p:try>
            <p:xinclude depends="cache-delete">
               <p:with-input>
                  <doc xmlns:xi="http://www.w3.org/2001/XInclude">
                     <xi:include href="https://xmlcalabash.com/does/not/exist.xml"/>
                  </doc>
               </p:with-input>
            </p:xinclude>
            <p:catch code="err:XC0029">
               <p:identity>
                  <p:with-input>
                     <correct/>
                  </p:with-input>
               </p:identity>
            </p:catch>
         </p:try>
      </p:declare-step>
   </t:pipeline>
</t:test>
