Skip to content

Commit

Permalink
Merge pull request #790 from ndw/new-static
Browse files Browse the repository at this point in the history
Tests for a selection of untested static errors
  • Loading branch information
ndw authored Dec 26, 2024
2 parents 418ed61 + f640a28 commit 44307a8
Show file tree
Hide file tree
Showing 18 changed files with 582 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test-suite/pipelines/err-xs0071.xpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<p:library xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://test"
version="3.0">

<p:option name="foo" static="true" select="7"/>
<p:option name="foo" static="true" select="11"/>

<p:declare-step type="ex:test">
<p:output port="result"/>
<p:identity>
<p:with-input><doc/></p:with-input>
</p:identity>
</p:declare-step>
</p:library>
38 changes: 38 additions & 0 deletions test-suite/tests/nw-err-xs0006-001.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0006">
<t:info>
<t:title>Test nw-err-xs0006-001</t:title>
<t:revision-history>
<t:revision>
<t:date>2024-12-26</t:date>
<t:author>
<t:name>Norm Tovey-Walsh</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Initial commit.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests that <code>err:XS0006</code> is raised.</p>
</t:description>

<t:pipeline>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://test"
version="3.0">
<p:output port="result"/>

<p:declare-step type="ex:not-primary">
<p:output port="result" primary="false"/>
<p:identity>
<p:with-input><doc/></p:with-input>
</p:identity>
</p:declare-step>

<ex:not-primary/>
</p:declare-step>
</t:pipeline>
</t:test>
30 changes: 30 additions & 0 deletions test-suite/tests/nw-err-xs0015-001.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0015">
<t:info>
<t:title>Test nw-err-xs0015-001</t:title>
<t:revision-history>
<t:revision>
<t:date>2024-12-26</t:date>
<t:author>
<t:name>Norm Tovey-Walsh</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Initial commit.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests that <code>err:XS0015</code> is raised.</p>
</t:description>

<t:pipeline>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://test"
version="3.0">
<p:output port="result"/>
<p:for-each/>
</p:declare-step>
</t:pipeline>
</t:test>
30 changes: 30 additions & 0 deletions test-suite/tests/nw-err-xs0015-002.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0015">
<t:info>
<t:title>Test nw-err-xs0015-002</t:title>
<t:revision-history>
<t:revision>
<t:date>2024-12-26</t:date>
<t:author>
<t:name>Norm Tovey-Walsh</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Initial commit.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests that <code>err:XS0015</code> is raised.</p>
</t:description>

<t:pipeline>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://test"
version="3.0">
<p:output port="result"/>
<p:viewport match="*"/>
</p:declare-step>
</t:pipeline>
</t:test>
30 changes: 30 additions & 0 deletions test-suite/tests/nw-err-xs0015-003.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0015">
<t:info>
<t:title>Test nw-err-xs0015-003</t:title>
<t:revision-history>
<t:revision>
<t:date>2024-12-26</t:date>
<t:author>
<t:name>Norm Tovey-Walsh</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Initial commit.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests that <code>err:XS0015</code> is raised.</p>
</t:description>

<t:pipeline>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://test"
version="3.0">
<p:output port="result"/>
<p:group/>
</p:declare-step>
</t:pipeline>
</t:test>
33 changes: 33 additions & 0 deletions test-suite/tests/nw-err-xs0015-004.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0015">
<t:info>
<t:title>Test nw-err-xs0015-004</t:title>
<t:revision-history>
<t:revision>
<t:date>2024-12-26</t:date>
<t:author>
<t:name>Norm Tovey-Walsh</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Initial commit.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests that <code>err:XS0015</code> is raised.</p>
</t:description>

<t:pipeline>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://test"
version="3.0">
<p:output port="result"/>
<p:choose>
<p:when test='true()'>
</p:when>
</p:choose>
</p:declare-step>
</t:pipeline>
</t:test>
36 changes: 36 additions & 0 deletions test-suite/tests/nw-err-xs0015-005.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0015">
<t:info>
<t:title>Test nw-err-xs0015-005</t:title>
<t:revision-history>
<t:revision>
<t:date>2024-12-26</t:date>
<t:author>
<t:name>Norm Tovey-Walsh</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Initial commit.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests that <code>err:XS0015</code> is raised.</p>
</t:description>

<t:pipeline>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://test"
version="3.0">
<p:output port="result"/>
<p:choose>
<p:when test='true()'>
<p:identity><p:with-input><doc/></p:with-input></p:identity>
</p:when>
<p:otherwise>
</p:otherwise>
</p:choose>
</p:declare-step>
</t:pipeline>
</t:test>
31 changes: 31 additions & 0 deletions test-suite/tests/nw-err-xs0015-006.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0015">
<t:info>
<t:title>Test nw-err-xs0015-006</t:title>
<t:revision-history>
<t:revision>
<t:date>2024-12-26</t:date>
<t:author>
<t:name>Norm Tovey-Walsh</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Initial commit.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests that <code>err:XS0015</code> is raised.</p>
</t:description>

<t:pipeline>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://test"
version="3.0">
<p:output port="result"/>
<p:if test="true()">
</p:if>
</p:declare-step>
</t:pipeline>
</t:test>
35 changes: 35 additions & 0 deletions test-suite/tests/nw-err-xs0015-007.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0015">
<t:info>
<t:title>Test nw-err-xs0015-007</t:title>
<t:revision-history>
<t:revision>
<t:date>2024-12-26</t:date>
<t:author>
<t:name>Norm Tovey-Walsh</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Initial commit.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests that <code>err:XS0015</code> is raised.</p>
</t:description>

<t:pipeline>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://test"
version="3.0">
<p:output port="result"/>
<p:try>
<p:identity>
<p:with-input><doc/></p:with-input>
</p:identity>
<p:catch/>
</p:try>
</p:declare-step>
</t:pipeline>
</t:test>
40 changes: 40 additions & 0 deletions test-suite/tests/nw-err-xs0015-008.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0015">
<t:info>
<t:title>Test nw-err-xs0015-008</t:title>
<t:revision-history>
<t:revision>
<t:date>2024-12-26</t:date>
<t:author>
<t:name>Norm Tovey-Walsh</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Initial commit.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests that <code>err:XS0015</code> is raised.</p>
</t:description>

<t:pipeline>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://test"
version="3.0">
<p:output port="result"/>
<p:try>
<p:identity>
<p:with-input><doc/></p:with-input>
</p:identity>
<p:catch>
<p:identity>
<p:with-input><doc/></p:with-input>
</p:identity>
</p:catch>
<p:finally/>
</p:try>
</p:declare-step>
</t:pipeline>
</t:test>
32 changes: 32 additions & 0 deletions test-suite/tests/nw-err-xs0029-001.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0029">
<t:info>
<t:title>Test nw-err-xs0029-001</t:title>
<t:revision-history>
<t:revision>
<t:date>2024-12-26</t:date>
<t:author>
<t:name>Norm Tovey-Walsh</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Initial commit.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests that <code>err:XS0029</code> is raised.</p>
</t:description>

<t:pipeline>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://test"
version="3.0">
<p:input port="source"/>
<p:output port="result">
<doc/>
</p:output>
</p:declare-step>
</t:pipeline>
</t:test>
33 changes: 33 additions & 0 deletions test-suite/tests/nw-err-xs0057-001.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:err="http://www.w3.org/ns/xproc-error"
expected="fail" code="err:XS0057">
<t:info>
<t:title>Test nw-err-xs0057-001</t:title>
<t:revision-history>
<t:revision>
<t:date>2024-12-26</t:date>
<t:author>
<t:name>Norm Tovey-Walsh</t:name>
</t:author>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Initial commit.</p>
</t:description>
</t:revision>
</t:revision-history>
</t:info>
<t:description xmlns="http://www.w3.org/1999/xhtml">
<p>Tests that <code>err:XS0057</code> is raised.</p>
</t:description>

<t:pipeline>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:ex="http://test"
version="3.0">
<p:output port="result"/>

<p:identity>
<p:with-input exclude-inline-prefixes="spoon"><doc/></p:with-input>
</p:identity>
</p:declare-step>
</t:pipeline>
</t:test>
Loading

0 comments on commit 44307a8

Please sign in to comment.