<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="pebble-006.xml"
        name="pebble-006.xml"
        expected="pass">
   <t:info>
      <t:title>pebble-006</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2025-12-25</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 the cx:pebble step works for json.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
                      xmlns:p="http://www.w3.org/ns/xproc"
                      exclude-inline-prefixes="cx"
                      name="main"
                      version="3.0">
         <p:import href="https://xmlcalabash.com/ext/library/pebble.xpl"/>
         <p:output port="result" sequence="true"/>
         <cx:pebble p:expand-text="false" context="map{'greeting': 'Hello, world.'}">
            <p:with-input>
               <p:inline content-type="application/json">{"greeting": "{{ greeting }}"}</p:inline>
            </p:with-input>
         </cx:pebble>
         <p:cast-content-type content-type="text/plain">
            <p:with-input select=".?greeting"/>
         </p:cast-content-type>
         <p:wrap-sequence wrapper="wrapper"/>
      </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="wrapper = &#34;&#34;&#34;Hello, world.&#34;&#34;&#34;">Template failed.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="pebble-006.xml">
      <wrapper>"Hello, world."</wrapper>
   </t:result>
</t:test>
