<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/rr-001.xml"
        name="rr-001.xml"
        expected="pass">
   <t:info>
      <t:title>railroad-001</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2025-01-30</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:railroad runs.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
                      xmlns:p="http://www.w3.org/ns/xproc"
                      name="main"
                      version="3.0">
         <p:import href="https://xmlcalabash.com/ext/library/railroad.xpl"/>
         <p:output port="result" sequence="true"/>
         <cx:railroad>
            <p:with-input>
               <p:inline content-type="text/plain">
S ::= a b
      </p:inline>
            </p:with-input>
         </cx:railroad>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
         <s:ns prefix="svg" uri="http://www.w3.org/2000/svg"/>
         <s:pattern>
            <s:rule context="/">
               <s:assert test="svg:svg">The root is wrong.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="rr-001.xml">
      <svg xmlns="http://www.w3.org/2000/svg" width="135" height="37">
         <defs>
            <style type="text/css" xml:space="preserve">
    @namespace "http://www.w3.org/2000/svg";
    .line                 {fill: none; stroke: #332900; stroke-width: 1;}
    .bold-line            {stroke: #141000; shape-rendering: crispEdges; stroke-width: 2;}
    .thin-line            {stroke: #1F1800; shape-rendering: crispEdges}
    .filled               {fill: #332900; stroke: none;}
    text.terminal         {font-family: Verdana, Sans-serif;
                            font-size: 12px;
                            fill: #141000;
                            font-weight: bold;
                          }
    text.nonterminal      {font-family: Verdana, Sans-serif;
                            font-size: 12px;
                            fill: #1A1400;
                            font-weight: normal;
                          }
    text.regexp           {font-family: Verdana, Sans-serif;
                            font-size: 12px;
                            fill: #1F1800;
                            font-weight: normal;
                          }
    rect, circle, polygon {fill: #332900; stroke: #332900;}
    rect.terminal         {fill: #ffdb4d; stroke: #332900; stroke-width: 1;}
    rect.nonterminal      {fill: #FFEC9E; stroke: #332900; stroke-width: 1;}
    rect.text             {fill: none; stroke: none;}
    polygon.regexp        {fill: #FFF4C7; stroke: #332900; stroke-width: 1;}
  </style>
         </defs>
         <polygon points="9 17 1 13 1 21"/>
         <polygon points="17 17 9 13 9 21"/>
         <a xmlns:xlink="http://www.w3.org/1999/xlink"
            xlink:href="#a"
            xlink:title="a"
            shape="rect">
            <rect x="31" y="3" width="28" height="32"/>
            <rect x="29" y="1" width="28" height="32" class="nonterminal"/>
            <text class="nonterminal" x="39" y="21">a</text>
         </a>
         <a xmlns:xlink="http://www.w3.org/1999/xlink"
            xlink:href="#b"
            xlink:title="b"
            shape="rect">
            <rect x="79" y="3" width="28" height="32"/>
            <rect x="77" y="1" width="28" height="32" class="nonterminal"/>
            <text class="nonterminal" x="87" y="21">b</text>
         </a>
         <path class="line"
               d="m17 17 h2 m0 0 h10 m28 0 h10 m0 0 h10 m28 0 h10 m3 0 h-3"/>
         <polygon points="125 17 133 13 133 21"/>
         <polygon points="125 17 117 13 117 21"/>
      </svg>
   </t:result>
</t:test>
