XSpec unit tests failing on unusual differences
Posted: Tue Aug 18, 2015 4:22 pm
Hi
I am using OxygenXML to write unit tests for some XSLT stylesheets I am working on.
Two of my tests is failing but I can't see why.
I have separated the failing tests into their own unit test doc and stylesheet
The xspec doc is as follows
and the xslt as follows
The tests were originally part of a much larger test suite as was the xslt but I have simplified it back as much as possible for debugging purposes.
The results of running the xspec are slightly strange - see screenshot
It seems that the xspec processor is adding an addition fullstop at the end of the output
Can anyone either replicate this? Or explain what I'm doing wrong?
Thanks
I am using OxygenXML to write unit tests for some XSLT stylesheets I am working on.
Two of my tests is failing but I can't see why.
I have separated the failing tests into their own unit test doc and stylesheet
The xspec doc is as follows
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<x:description xmlns:x="http://www.jenitennison.com/xslt/xspec" stylesheet="email-test.xsl">
<x:scenario label="Testing email processing and white space management">
<x:scenario label="email1">
<x:context><email username="info.london" edomname="croports.com"/></x:context>
<x:expect label="inline items"><a href="mailto:info.london@croports.com">info.london@croports.com</a> </x:expect>
</x:scenario>
<x:scenario label="email2">
<x:context><email address="info.london@croports.com"/></x:context>
<x:expect label="inline items"><a href="mailto:info.london@croports.com">info.london@croports.com</a></x:expect>
</x:scenario>
</x:scenario>
</x:description>
Code: Select all
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
exclude-result-prefixes="xd"
version="2.0">
<xsl:template match="email[@edomname]">
<xsl:variable name="email-addr" select="concat(@username,'@',@edomname)"/>
<a href="{concat('mailto:',$email-addr)}"><xsl:value-of select="$email-addr"/></a><xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="email[@address]">
<xsl:variable name="email-addr" select="@address"/>
<a href="{concat('mailto:',$email-addr)}"><xsl:value-of select="$email-addr"/></a><xsl:text> </xsl:text>
</xsl:template>
</xsl:stylesheet>
The results of running the xspec are slightly strange - see screenshot
It seems that the xspec processor is adding an addition fullstop at the end of the output
Can anyone either replicate this? Or explain what I'm doing wrong?
Thanks