p:compare 004 (NW)

Check if p:compare raises an error when the documents are different and fail-if-not-equal is true.

Test is expected to fail with error code err:XC0019.

The pipeline

<p:declare-step xmlns:err="http://www.w3.org/ns/xproc-error"
                xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:t="http://xproc.org/ns/testsuite/3.0" xmlns:test="http://test" version="3.0">
   <p:output port="result">
      <p:pipe step="compare" port="result"/>
   </p:output>
   <p:identity name="doc-a">
      <p:with-input>
         <doc>
            <element name="first"/>
            <element/>
         </doc>
      </p:with-input>
   </p:identity>
   <p:identity name="doc-b">
      <p:with-input>
         <doc>
            <element name="second"/>
            <element/>
         </doc>
      </p:with-input>
   </p:identity>
   <p:compare name="compare" fail-if-not-equal="true">
      <p:with-input port="source" pipe="@doc-a"/>
      <p:with-input port="alternate" pipe="@doc-b"/>
   </p:compare>
</p:declare-step>

Revision history

26 Mar 2024, Norm Tovey-Walsh
Created test for p:compare.