cmdline-004
Simple test of the command-line testing framework.
Test is expected to pass.
The pipeline
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0" name="main">
<p:output port="result" primary="true"/>
<p:output port="alternate" pipe="@alt"/>
<p:identity name="alt">
<p:with-input>
<doc>alternate</doc>
</p:with-input>
</p:identity>
<p:identity>
<p:with-input>
<doc>primary</doc>
</p:with-input>
</p:identity>
</p:declare-step>
Schematron checks
<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron"
xmlns:t="http://xproc.org/ns/testsuite/3.0" queryBinding="xslt2">
<s:pattern>
<s:rule context="/">
<s:assert test="directory">The root is wrong.</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/directory">
<s:assert test="count(*) = 2">Wrong number of results</s:assert>
<s:assert test="mime[@uri='output.mime']">No MIME</s:assert>
<s:assert test="file[@uri='_stdout']">No stdout</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/directory/mime">
<s:assert test="count(part) = 2">Wrong number of parts</s:assert>
<s:assert test="empty(part[@port='alternate']/body/headers/node())">Alternate is wrong</s:assert>
<s:assert test="part[@port='alternate']/body/doc[. = 'alternate']">Alternate is wrong</s:assert>
<s:assert test="empty(part[@port='result']/body/headers/node())">Result is wrong</s:assert>
<s:assert test="part[@port='result']/body/doc[. = 'primary']">Result is wrong</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/directory/file[@uri='_stdout']">
<s:assert test="string(.) = ''">Stdout should be empty</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 22 Feb 2026, Norm Tovey-Walsh
- Created test.