Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New test for shared, common input #783

Merged
merged 1 commit into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions test-suite/pipelines/nw-import-002-lib-common.xpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<p:library xmlns:p="http://www.w3.org/ns/xproc"
xmlns:test="http://test" version="3.0">

<p:declare-step type="test:common-step">
<p:output port="result"/>
<p:identity>
<p:with-input><common/></p:with-input>
</p:identity>
</p:declare-step>

</p:library>
14 changes: 14 additions & 0 deletions test-suite/pipelines/nw-import-002-lib1.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:test="http://test" version="3.0">

<p:import href="nw-import-002-lib2.xpl"/>
<p:import href="nw-import-002-lib-common.xpl"/>

<p:declare-step type="test:one">
<p:output port="result"/>
<p:identity>
<p:with-input><one/></p:with-input>
</p:identity>
</p:declare-step>

</p:library>
13 changes: 13 additions & 0 deletions test-suite/pipelines/nw-import-002-lib2.xpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<p:library xmlns:p="http://www.w3.org/ns/xproc"
xmlns:test="http://test" version="3.0">

<p:import href="nw-import-002-lib-common.xpl"/>

<p:declare-step type="test:two">
<p:output port="result"/>
<p:identity>
<p:with-input><two/></p:with-input>
</p:identity>
</p:declare-step>

</p:library>
43 changes: 43 additions & 0 deletions test-suite/tests/nw-import-002.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?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-import-002</t:title>
<t:revision-history>
<t:revision>
<t:date>2024-12-24</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>This test verifies that multiple imports of the same common library do
not count as duplicates. It’s derived from a real-world bug report from Achim.</p>
</t:description>
<t:pipeline>
<p:declare-step version="3.0"
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:test="http://test">
<p:import href="../pipelines/nw-import-002-lib1.xpl"/>
<p:import href="../pipelines/nw-import-002-lib2.xpl"/>
<p:output port="result"/>
<test:common-step/>
</p:declare-step>
</t:pipeline>
<t:schematron>
<s:schema queryBinding="xslt2"
xmlns:s="http://purl.oclc.org/dsdl/schematron"
xmlns="http://www.w3.org/1999/xhtml">
<s:pattern>
<s:rule context="/">
<s:assert test="common">The pipeline root is not “common”.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
</t:schematron>
</t:test>