Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coverage-report.xsl fails to parse CDATA #214

Closed
AirQuick opened this issue Jun 12, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@AirQuick
Copy link
Member

commented Jun 12, 2018

test.xsl:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="input">
		<output><![CDATA[
test
]]></output>
	</xsl:template>
</xsl:stylesheet>

test.xspec:

<?xml version="1.0" encoding="UTF-8"?>
<x:description stylesheet="test.xsl" xmlns:x="http://www.jenitennison.com/xslt/xspec">
	<x:scenario label="input">
		<x:context>
			<input />
		</x:context>
		<x:expect label="output">
			<output><![CDATA[
test
]]></output>
		</x:expect>
	</x:scenario>
</x:description>

With the files above, XSpec code coverage fails:

C:\test>bin\xspec.bat -c test.xspec
...
Formatting Report...
passed: 1 / pending: 0 / failed: 0 / total: 1

        unmatched string: &lt;![CDATA[
test
]]&gt;&lt;/output&gt;
        &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;

Error on line 267 column 36 of coverage-report.xsl:
  XTMM9000: Processing terminated by xsl:message at line 267 in coverage-report.xsl
...

The problem can be fixed by inserting a missing ! into construct-regex:

(&lt;\[CDATA\[ <!-- 7: a CDATA section -->

But then the coverage report HTML describes the lines after CDATA as ignored:
ignored

@AirQuick AirQuick added the bug label Jun 12, 2018

@AirQuick AirQuick self-assigned this Jun 12, 2018

AirQuick added a commit that referenced this issue Feb 23, 2019

@AirQuick AirQuick referenced this issue Apr 30, 2019

Closed

Release v1.3.0 #563

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.