<?xml version="1.0" encoding="UTF-8"?>
<t:test expected="fail" code="cxerr:XC0006"
        xmlns:cxerr="http://xmlcalabash.com/ns/error"
        xmlns:t="http://xproc.org/ns/testsuite/3.0">
  <t:info>
    <t:title>collmgr-003</t:title>
    <t:revision-history>
      <t:revision>
        <t:date>2025-01-23</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">
    <p>Tests that cx:collection-manager fails if an attempt is made to modify a stable collection.</p>
  </t:description>
  <t:pipeline>
    <p:declare-step version="3.0"
                    xmlns:err="http://www.w3.org/ns/xproc-error"
                    xmlns:cx="http://xmlcalabash.com/ns/extensions"
                    xmlns:p="http://www.w3.org/ns/xproc">
      <p:import href="https://xmlcalabash.com/ext/library/collection-manager.xpl"/>
      <p:output port="result"/>

      <!-- N.B. The test-driver does not make inline URIs unique -->
      <cx:collection-manager name="one" source="http://example.com/c1">
        <p:with-input>
          <p:inline><doc/></p:inline>
        </p:with-input>
      </cx:collection-manager>

      <cx:collection-manager source="http://example.com/c1" p:depends="one">
        <p:with-input>
          <p:inline><doc/></p:inline>
        </p:with-input>
      </cx:collection-manager>
    </p:declare-step>
  </t:pipeline>
</t:test>
