-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #769 from ndw/transitive
Simple tests for step type and option transitivity
- Loading branch information
Showing
7 changed files
with
218 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<p:library xmlns:p="http://www.w3.org/ns/xproc" version="3.0"> | ||
|
||
<p:import href="ab-library-001.xpl"/> | ||
|
||
<p:declare-step type="Q{http://test}three" | ||
xmlns:t="http://test"> | ||
<p:output port="result" /> | ||
<t:one/> | ||
<p:rename match="/one" new-name="three"/> | ||
</p:declare-step> | ||
|
||
</p:library> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<p:library xmlns:p="http://www.w3.org/ns/xproc" version="3.0"> | ||
|
||
<p:import href="ab-library-015.xpl"/> | ||
|
||
<p:option name="option2" static="true" select="'π'"/> | ||
|
||
</p:library> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<t:test expected="pass" | ||
xmlns:t="http://xproc.org/ns/testsuite/3.0"> | ||
<t:info> | ||
<t:title>nw-library-001</t:title> | ||
<t:revision-history> | ||
<t:revision> | ||
<t:date>2024-12-06</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 step imports are transitive.</p> | ||
</t:description> | ||
<t:pipeline> | ||
<p:declare-step version="3.0" | ||
xmlns:p="http://www.w3.org/ns/xproc" | ||
xmlns:x="http://test"> | ||
<p:import href="../pipelines/nw-library-001.xpl"/> | ||
<p:output port="result"/> | ||
|
||
<x:one name="a"/> | ||
<x:two name="b"/> | ||
<x:three name="c"/> | ||
|
||
<p:wrap-sequence wrapper="result"> | ||
<p:with-input pipe="@a @b @c"/> | ||
</p:wrap-sequence> | ||
</p:declare-step> | ||
</t:pipeline> | ||
<t:schematron> | ||
<s:schema queryBinding="xslt2" | ||
xmlns:s="http://purl.oclc.org/dsdl/schematron"> | ||
<s:pattern> | ||
<s:rule context="/"> | ||
<s:assert test="result">The document root is not result.</s:assert> | ||
<s:assert test="result/*[1]/self::one">The first child is not ‘one’</s:assert> | ||
<s:assert test="result/*[2]/self::two">The first child is not ‘two’</s:assert> | ||
<s:assert test="result/*[3]/self::three">The first child is not ‘three’</s:assert> | ||
</s:rule> | ||
</s:pattern> | ||
</s:schema> | ||
</t:schematron> | ||
</t:test> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<t:test expected="fail" code="err:XS0036" | ||
xmlns:err="http://www.w3.org/ns/xproc-error" | ||
xmlns:t="http://xproc.org/ns/testsuite/3.0"> | ||
<t:info> | ||
<t:title>nw-library-002</t:title> | ||
<t:revision-history> | ||
<t:revision> | ||
<t:date>2024-12-06</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 step imports are transitive.</p> | ||
</t:description> | ||
<t:pipeline> | ||
<p:declare-step version="3.0" | ||
xmlns:p="http://www.w3.org/ns/xproc" | ||
xmlns:x="http://test"> | ||
<p:import href="../pipelines/nw-library-001.xpl"/> | ||
<p:output port="result"/> | ||
|
||
<p:declare-step type="x:one"> | ||
<p:output port="result" /> | ||
<p:identity> | ||
<p:with-input><one-prime /></p:with-input> | ||
</p:identity> | ||
</p:declare-step> | ||
|
||
<x:one name="a"/> | ||
<x:two name="b"/> | ||
<x:three name="c"/> | ||
|
||
<p:wrap-sequence wrapper="result"> | ||
<p:with-input pipe="@a @b @c"/> | ||
</p:wrap-sequence> | ||
</p:declare-step> | ||
</t:pipeline> | ||
</t:test> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<t:test expected="pass" | ||
xmlns:t="http://xproc.org/ns/testsuite/3.0"> | ||
<t:info> | ||
<t:title>nw-library-003</t:title> | ||
<t:revision-history> | ||
<t:revision> | ||
<t:date>2024-12-06</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 option imports are transitive.</p> | ||
</t:description> | ||
<t:pipeline> | ||
<p:declare-step version="3.0" | ||
xmlns:p="http://www.w3.org/ns/xproc" | ||
xmlns:x="http://test"> | ||
<p:import href="../pipelines/nw-library-002.xpl"/> | ||
<p:output port="result"/> | ||
|
||
<p:identity> | ||
<p:with-input> | ||
<result> | ||
<option>{$option}</option> | ||
<pi>{$option2}</pi> | ||
</result> | ||
</p:with-input> | ||
</p:identity> | ||
</p:declare-step> | ||
</t:pipeline> | ||
<t:schematron> | ||
<s:schema queryBinding="xslt2" | ||
xmlns:s="http://purl.oclc.org/dsdl/schematron"> | ||
<s:pattern> | ||
<s:rule context="/"> | ||
<s:assert test="result">The document root is not result.</s:assert> | ||
<s:assert test="result/option = 42">The option value isn’t 42.</s:assert> | ||
<s:assert test="result/pi = 'π'">The pi value isn’t π.</s:assert> | ||
</s:rule> | ||
</s:pattern> | ||
</s:schema> | ||
</t:schematron> | ||
</t:test> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<t:test expected="fail" code="err:XS0088" | ||
xmlns:err="http://www.w3.org/ns/xproc-error" | ||
xmlns:t="http://xproc.org/ns/testsuite/3.0"> | ||
<t:info> | ||
<t:title>nw-library-004</t:title> | ||
<t:revision-history> | ||
<t:revision> | ||
<t:date>2024-12-06</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 option imports are transitive.</p> | ||
</t:description> | ||
<t:pipeline> | ||
<p:declare-step version="3.0" | ||
xmlns:p="http://www.w3.org/ns/xproc" | ||
xmlns:x="http://test"> | ||
<p:import href="../pipelines/nw-library-002.xpl"/> | ||
<p:output port="result"/> | ||
|
||
<p:option name="option" select="'bzzzt. nope.'"/> | ||
|
||
<p:identity> | ||
<p:with-input> | ||
<result> | ||
<option>{$option}</option> | ||
</result> | ||
</p:with-input> | ||
</p:identity> | ||
</p:declare-step> | ||
</t:pipeline> | ||
</t:test> |