Skip to content

Commit

Permalink
added test for issue #4
Browse files Browse the repository at this point in the history
commit 9f88e28 seems to fix #4 - this commit provides a regression test for it
  • Loading branch information
josteinaj committed May 9, 2014
1 parent 24866cd commit 76ee1e0
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step name="main" xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:ex="http://example.net/ns" type="ex:temp-dir-option" version="1.0">

<p:output port="result" primary="true"/>

<p:option name="temp-dir" select="'default temp-dir value'"/>
<p:option name="output-dir" select="'default output-dir value'"/>

<p:add-attribute match="/*" attribute-name="temp-dir">
<p:input port="source">
<p:inline exclude-inline-prefixes="#all">
<c:result/>
</p:inline>
</p:input>
<p:with-option name="attribute-value" select="$temp-dir"/>
</p:add-attribute>

<p:add-attribute match="/*" attribute-name="output-dir">
<p:with-option name="attribute-value" select="$output-dir"/>
</p:add-attribute>

</p:declare-step>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://www.daisy.org/ns/xprocspec/xprocspec.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<x:description xmlns:x="http://www.daisy.org/ns/xprocspec" xmlns:ex="http://example.net/ns" script="../../steps/temp-dir-option.xpl">

<x:scenario label="temp-dir">
<x:call step="ex:temp-dir-option">
<x:option name="temp-dir" select="'xprocspec temp-dir value'"/>
<x:option name="output-dir" select="'xprocspec output-dir value'"/>
</x:call>
<x:context label="the result">
<x:document type="port" port="result"/>
</x:context>
<x:expect type="count" label="there should be one document on the result port" min="1" max="1"/>
<x:expect type="xpath" label="the value of the temp-dir attribute should be 'xprocspec temp-dir value'" test="/*/@temp-dir" equals="'xprocspec temp-dir value'"/>
<x:expect type="xpath" label="the value of the output-dir attribute should be 'xprocspec output-dir value'" test="/*/@output-dir" equals="'xprocspec output-dir value'"/>
</x:scenario>

</x:description>

0 comments on commit 76ee1e0

Please sign in to comment.