-
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.
Ported p:filter tests from 1.0 test suite
- Loading branch information
1 parent
f0e21a2
commit 8290e11
Showing
3 changed files
with
147 additions
and
0 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,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>p:filter-001 (AB)</t:title> | ||
<t:revision-history> | ||
<t:revision> | ||
<t:date>2024-05-12</t:date> | ||
<t:author> | ||
<t:name>Achim Berndzen</t:name> | ||
</t:author> | ||
<t:description xmlns="http://www.w3.org/1999/xhtml"> | ||
<p>Ported test from XProc (1.0) test suite.</p> | ||
</t:description> | ||
</t:revision> | ||
</t:revision-history> | ||
</t:info> | ||
<t:description xmlns="http://www.w3.org/1999/xhtml"> | ||
<p>Tests p:filter with a variable in p:with-option.</p> | ||
</t:description> | ||
<t:pipeline> | ||
<p:declare-step version="3.0" | ||
xmlns:p="http://www.w3.org/ns/xproc"> | ||
<p:output port="result"/> | ||
<p:variable name="element" select="'p'"/> | ||
|
||
<p:filter> | ||
<p:with-input> | ||
<doc> | ||
<?pi test?> | ||
<p>This is a p.</p> | ||
</doc> | ||
</p:with-input> | ||
<p:with-option name="select" select="concat('//*[local-name(.) = "',$element,'"]')"/> | ||
</p:filter> | ||
</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="p">Root element is not 'p'.</s:assert> | ||
<s:assert test="p/text()='This is a p.'">Text content of 'p' is wrong.</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,49 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<t:test expected="pass" | ||
xmlns:t="http://xproc.org/ns/testsuite/3.0"> | ||
<t:info> | ||
<t:title>p:filter-002 (AB)</t:title> | ||
<t:revision-history> | ||
<t:revision> | ||
<t:date>2024-05-12</t:date> | ||
<t:author> | ||
<t:name>Achim Berndzen</t:name> | ||
</t:author> | ||
<t:description xmlns="http://www.w3.org/1999/xhtml"> | ||
<p>Ported test from XProc (1.0) test suite.</p> | ||
</t:description> | ||
</t:revision> | ||
</t:revision-history> | ||
</t:info> | ||
<t:description xmlns="http://www.w3.org/1999/xhtml"> | ||
<p>Tests p:filter with an unused element name.</p> | ||
</t:description> | ||
<t:pipeline> | ||
<p:declare-step version="3.0" | ||
xmlns:p="http://www.w3.org/ns/xproc"> | ||
<p:output port="result"/> | ||
|
||
<p:filter select="/someunknownelement"> | ||
<p:with-input> | ||
<doc> | ||
<?pi test?> | ||
<p>This is a p.</p> | ||
</doc> | ||
</p:with-input> | ||
</p:filter> | ||
<p:wrap-sequence wrapper="result" /> | ||
</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="result">Root element is not 'result'.</s:assert> | ||
<s:assert test="empty(result/*)">Root element should have no children.</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,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<t:test expected="pass" | ||
xmlns:t="http://xproc.org/ns/testsuite/3.0"> | ||
<t:info> | ||
<t:title>p:filter-003 (AB)</t:title> | ||
<t:revision-history> | ||
<t:revision> | ||
<t:date>2024-05-12</t:date> | ||
<t:author> | ||
<t:name>Achim Berndzen</t:name> | ||
</t:author> | ||
<t:description xmlns="http://www.w3.org/1999/xhtml"> | ||
<p>Ported test from XProc (1.0) test suite.</p> | ||
</t:description> | ||
</t:revision> | ||
</t:revision-history> | ||
</t:info> | ||
<t:description xmlns="http://www.w3.org/1999/xhtml"> | ||
<p>Tests p:filter.</p> | ||
</t:description> | ||
<t:pipeline> | ||
<p:declare-step version="3.0" | ||
xmlns:p="http://www.w3.org/ns/xproc"> | ||
<p:output port="result"/> | ||
|
||
<p:filter select="/doc/*"> | ||
<p:with-input> | ||
<doc> | ||
<?pi test?> | ||
<p>This is a p.</p> | ||
</doc> | ||
</p:with-input> | ||
</p:filter> | ||
</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="p">Root element is not 'p'.</s:assert> | ||
<s:assert test="p/text()='This is a p.'">Text content of 'p' is wrong.</s:assert> | ||
</s:rule> | ||
</s:pattern> | ||
</s:schema> | ||
</t:schematron> | ||
</t:test> |