diff options
Diffstat (limited to 'test')
-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 | ||||
-rw-r--r-- | test/read_directory/reference.xml | 1 | ||||
-rw-r--r-- | test/read_file/transformation.xsl | 2 | ||||
-rw-r--r-- | test/read_xml_file/transformation.xsl | 2 |
6 files changed, 96 insertions, 2 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> diff --git a/test/read_directory/reference.xml b/test/read_directory/reference.xml index a7192ea..94e639e 100644 --- a/test/read_directory/reference.xml +++ b/test/read_directory/reference.xml @@ -2,6 +2,7 @@ <test_case> <item>common</item> <item>default_params</item> +<item>external_text_formatter</item> <item>read_directory</item> <item>read_file</item> <item>read_xml_file</item> diff --git a/test/read_file/transformation.xsl b/test/read_file/transformation.xsl index e17734e..f773e0e 100644 --- a/test/read_file/transformation.xsl +++ b/test/read_file/transformation.xsl @@ -9,7 +9,7 @@ <xsl:include href="[testcase.xsl]"/> <xsl:template name="implementation"> - <xsl:value-of select="InputXSLT:read-file('../common/test.txt')"/> + <xsl:value-of select="InputXSLT:read-file('test.txt')"/> </xsl:template> </xsl:stylesheet> diff --git a/test/read_xml_file/transformation.xsl b/test/read_xml_file/transformation.xsl index e0a3794..2a6c5e5 100644 --- a/test/read_xml_file/transformation.xsl +++ b/test/read_xml_file/transformation.xsl @@ -9,7 +9,7 @@ <xsl:include href="[testcase.xsl]"/> <xsl:template name="implementation"> - <xsl:for-each select="InputXSLT:read-xml-file('../common/test.txt')/tester/eintrag"> + <xsl:for-each select="InputXSLT:read-xml-file('test.txt')/tester/eintrag"> <item><xsl:value-of select="."/></item> </xsl:for-each> </xsl:template> |