<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="ab-cast-content-type-032.xml"
        name="ab-cast-content-type-032.xml"
        expected="pass">
   <t:info>
      <t:title>cast-content-type 032 (AB)</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2025-02-02</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Test casting from c:data to Text.</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Tests that a c:data document is decoded if cast to Text, default encoding.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="pipeline" version="3.0">
         <p:output port="result"/>
         <p:cast-content-type content-type="text/plain">
            <p:with-input>
               <c:data xmlns:c="http://www.w3.org/ns/xproc-step" content-type="text/plain">Q29weSDCqQ==</c:data>
            </p:with-input>
         </p:cast-content-type>
         <p:wrap-sequence wrapper="result"/>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
         <s:pattern>
            <s:rule context="/">
               <s:assert test="result">The root element is not 'result'.</s:assert>
               <s:assert test="result/text()='Copy ©'">The text is not correctly decoded.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="ab-cast-content-type-032.xml">
      <result>Copy ©</result>
   </t:result>
</t:test>
