diff options
author | Adrian Kummerländer | 2014-05-26 20:13:11 +0200 |
---|---|---|
committer | Adrian Kummerländer | 2014-05-26 20:13:11 +0200 |
commit | 6efa3385ae0fab5f7b6e3a113d1da18cfbed8591 (patch) | |
tree | 043220ff989ef5e17b04286e510b9c6984e96ae5 /test/external_text_formatter | |
parent | 86f8e73299e86b65affc1a71610dd061fa13bf5c (diff) | |
download | InputXSLT-6efa3385ae0fab5f7b6e3a113d1da18cfbed8591.tar InputXSLT-6efa3385ae0fab5f7b6e3a113d1da18cfbed8591.tar.gz InputXSLT-6efa3385ae0fab5f7b6e3a113d1da18cfbed8591.tar.bz2 InputXSLT-6efa3385ae0fab5f7b6e3a113d1da18cfbed8591.tar.lz InputXSLT-6efa3385ae0fab5f7b6e3a113d1da18cfbed8591.tar.xz InputXSLT-6efa3385ae0fab5f7b6e3a113d1da18cfbed8591.tar.zst InputXSLT-6efa3385ae0fab5f7b6e3a113d1da18cfbed8591.zip |
Added "external-text-formatter" test case
* test case requires markdown.pl formatter to be available in "/usr/bin/"
* updated README.md to mention "external-text-formatter" instead of "execute"
* updated "read-directory" test case reference file
* included library resolution test into "read-file" and "read-xml-file" test cases
Diffstat (limited to 'test/external_text_formatter')
-rw-r--r-- | test/external_text_formatter/reference.xml | 33 | ||||
-rw-r--r-- | test/external_text_formatter/test.md | 28 | ||||
-rw-r--r-- | test/external_text_formatter/transformation.xsl | 32 |
3 files changed, 93 insertions, 0 deletions
diff --git a/test/external_text_formatter/reference.xml b/test/external_text_formatter/reference.xml new file mode 100644 index 0000000..a98b3d8 --- /dev/null +++ b/test/external_text_formatter/reference.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<test_case> +<h1>Markdown Test</h1> +<p> +<strong>Lorem ipsum</strong> dolor sit amet, <em>consectetur</em> adipisicing elit, sed do <code>eiusmod</code> tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> +<blockquote> + <p>Duis aute irure dolor in reprehenderit in voluptate +velit esse cillum dolore eu fugiat nulla pariatur.</p> +</blockquote> +<p>Excepteur sint <strong>occaecat</strong> cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> +<ul> +<li>Test 1</li> +<li>Test 2</li> +<li>Test 3</li> +<li>Test 4</li> +</ul> +<p>Test Test Test</p> +<pre> +<code>template < + typename Target, + std::size_t Index = 0, + typename Current = std::tuple<>, + enable_if<Index == std::tuple_size<Target>::value> = 0 +> +inline Target construct( + const xalan::XPathExecutionContext::XObjectArgVectorType&, + Current&& current +) { + return current; +} +</code> +</pre> +</test_case> diff --git a/test/external_text_formatter/test.md b/test/external_text_formatter/test.md new file mode 100644 index 0000000..9402e4f --- /dev/null +++ b/test/external_text_formatter/test.md @@ -0,0 +1,28 @@ +# Markdown Test + +__Lorem ipsum__ dolor sit amet, _consectetur_ adipisicing elit, sed do `eiusmod` tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. + +> Duis aute irure dolor in reprehenderit in voluptate +> velit esse cillum dolore eu fugiat nulla pariatur. + +Excepteur sint **occaecat** cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + +* Test 1 +* Test 2 +* Test 3 +* Test 4 + +Test Test Test + + template < + typename Target, + std::size_t Index = 0, + typename Current = std::tuple<>, + enable_if<Index == std::tuple_size<Target>::value> = 0 + > + inline Target construct( + const xalan::XPathExecutionContext::XObjectArgVectorType&, + Current&& current + ) { + return current; + } diff --git a/test/external_text_formatter/transformation.xsl b/test/external_text_formatter/transformation.xsl new file mode 100644 index 0000000..00fe3b3 --- /dev/null +++ b/test/external_text_formatter/transformation.xsl @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet + version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:dyn="http://exslt.org/dynamic" + xmlns:xalan="http://xml.apache.org/xalan" + xmlns:InputXSLT="function.inputxslt.application" + exclude-result-prefixes="dyn xalan InputXSLT" +> + +<xsl:include href="[testcase.xsl]"/> + +<xsl:template name="formatter"> + <xsl:param name="source"/> + + <xsl:variable name="command"> + InputXSLT:external-text-formatter( + '/usr/bin/markdown', + $source + ) + </xsl:variable> + + <xsl:copy-of select="dyn:evaluate($command)/output/*"/> +</xsl:template> + +<xsl:template name="implementation"> + <xsl:call-template name="formatter"> + <xsl:with-param name="source" select="InputXSLT:read-file('test.md')"/> + </xsl:call-template> +</xsl:template> + +</xsl:stylesheet> |