forked from expath/xspec
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
test/end-to-end/cases-coverage/expected/stylesheet/issue-1917-choose-first-coverage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<title>Test Coverage Report for issue-1917.xsl</title> | ||
<link rel="stylesheet" type="text/css" href="../../../../../src/reporter/test-report.css" /> | ||
</head> | ||
<body> | ||
<h1>Test Coverage Report</h1> | ||
<p>Stylesheet: <a href="../../issue-1917.xsl">issue-1917.xsl</a></p> | ||
<h2>module: issue-1917.xsl; 29 lines</h2> | ||
<pre>01: <span class="ignored"><?xml version="1.0" encoding="UTF-8" ?></span> | ||
02: <span class="ignored"><xsl:stylesheet version="3.0" xmlns:local="http://local/xslt" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"></span> | ||
03: <span class="ignored"> </span><span class="ignored"><xsl:output method="text" /></span> | ||
04: | ||
05: <span class="ignored"> </span><span class="hit"><xsl:function name="local:func-choose"></span> | ||
06: <span class="ignored"> </span><span class="hit"><xsl:param name="text" /></span> | ||
07: <span class="ignored"> </span><span class="hit"><xsl:choose></span> | ||
08: <span class="ignored"> </span><span class="hit"><xsl:when test="$text = 'one'"></span> | ||
09: <span class="ignored"> </span><span class="hit"><xsl:text></span><span class="hit">1</span><span class="hit"></xsl:text></span> | ||
10: <span class="ignored"> </span><span class="hit"></xsl:when></span> | ||
11: <span class="ignored"> </span><span class="missed"><xsl:otherwise></span><span class="ignored"> </span><span class="ignored"><!-- Expected miss --></span> | ||
12: <span class="ignored"> </span><span class="missed"><xsl:text></span><span class="missed">0</span><span class="missed"></xsl:text></span><span class="ignored"> </span><span class="ignored"><!-- Expected miss --></span> | ||
13: <span class="ignored"> </span><span class="missed"></xsl:otherwise></span><span class="ignored"> </span><span class="ignored"><!-- Expected miss --></span> | ||
14: <span class="ignored"> </span><span class="hit"></xsl:choose></span> | ||
15: <span class="ignored"> </span><span class="hit"></xsl:function></span> | ||
16: | ||
17: <span class="ignored"> </span><span class="hit"><xsl:function name="local:func-variable"></span> | ||
18: <span class="ignored"> </span><span class="hit"><xsl:param name="text" /></span> | ||
19: <span class="ignored"> </span><span class="hit"><xsl:variable name="normalizedText"></span> | ||
20: <span class="ignored"> </span><span class="hit"><xsl:value-of select="normalize-space($text)" /></span> | ||
21: <span class="ignored"> </span><span class="hit"></xsl:variable></span> | ||
22: <span class="ignored"> </span><span class="hit"><xsl:if test="$normalizedText = 'one'"></span> | ||
23: <span class="ignored"> </span><span class="hit"><xsl:text></span><span class="hit">1</span><span class="hit"></xsl:text></span> | ||
24: <span class="ignored"> </span><span class="hit"></xsl:if></span> | ||
25: <span class="ignored"> </span><span class="hit"><xsl:if test="$normalizedText != 'one'"></span> | ||
26: <span class="ignored"> </span><span class="missed"><xsl:text></span><span class="missed">0</span><span class="missed"></xsl:text></span><span class="ignored"> </span><span class="ignored"><!-- Expected miss --></span> | ||
27: <span class="ignored"> </span><span class="hit"></xsl:if></span> | ||
28: <span class="ignored"> </span><span class="hit"></xsl:function></span> | ||
29: <span class="ignored"></xsl:stylesheet></span></pre> | ||
</body> | ||
</html> |
24 changes: 24 additions & 0 deletions
24
test/end-to-end/cases-coverage/expected/stylesheet/issue-1917-choose-first-coverage.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<trace xspec="../../issue-1917-choose-first.xspec"> | ||
<compiled uri="issue-1917-choose-first-compiled.xsl"/> | ||
<module moduleId="0" uri="../../issue-1917.xsl"/> | ||
<traceable traceableId="0" | ||
class="net.sf.saxon.expr.instruct.UserFunction" | ||
uqname="Q{http://www.w3.org/1999/XSL/Transform}function"/> | ||
<hit lineNumber="5" columnNumber="42" moduleId="0" traceableId="0"/> | ||
<traceable traceableId="1" | ||
class="net.sf.saxon.expr.instruct.TraceExpression" | ||
uqname="Q{http://www.w3.org/1999/XSL/Transform}choose"/> | ||
<hit lineNumber="7" columnNumber="17" moduleId="0" traceableId="1"/> | ||
<hit lineNumber="9" columnNumber="19" moduleId="0" traceableId="1"/> | ||
<util utilId="0" uri="../../../../../src/common/report-sequence.xsl"/> | ||
<util utilId="1" uri="../../../../../src/common/common-utils.xsl"/> | ||
<util utilId="2" uri="../../../../../src/common/deep-equal.xsl"/> | ||
<hit lineNumber="17" columnNumber="44" moduleId="0" traceableId="0"/> | ||
<hit lineNumber="19" columnNumber="41" moduleId="0" traceableId="1"/> | ||
<hit lineNumber="22" columnNumber="44" moduleId="0" traceableId="1"/> | ||
<hit lineNumber="20" columnNumber="55" moduleId="0" traceableId="1"/> | ||
<hit lineNumber="20" columnNumber="55" moduleId="0" traceableId="1"/> | ||
<hit lineNumber="23" columnNumber="17" moduleId="0" traceableId="1"/> | ||
<hit lineNumber="25" columnNumber="45" moduleId="0" traceableId="1"/> | ||
</trace> |
41 changes: 41 additions & 0 deletions
41
test/end-to-end/cases-coverage/expected/stylesheet/issue-1917-variable-first-coverage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<title>Test Coverage Report for issue-1917.xsl</title> | ||
<link rel="stylesheet" type="text/css" href="../../../../../src/reporter/test-report.css" /> | ||
</head> | ||
<body> | ||
<h1>Test Coverage Report</h1> | ||
<p>Stylesheet: <a href="../../issue-1917.xsl">issue-1917.xsl</a></p> | ||
<h2>module: issue-1917.xsl; 29 lines</h2> | ||
<pre>01: <span class="ignored"><?xml version="1.0" encoding="UTF-8" ?></span> | ||
02: <span class="ignored"><xsl:stylesheet version="3.0" xmlns:local="http://local/xslt" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"></span> | ||
03: <span class="ignored"> </span><span class="ignored"><xsl:output method="text" /></span> | ||
04: | ||
05: <span class="ignored"> </span><span class="hit"><xsl:function name="local:func-choose"></span> | ||
06: <span class="ignored"> </span><span class="hit"><xsl:param name="text" /></span> | ||
07: <span class="ignored"> </span><span class="hit"><xsl:choose></span> | ||
08: <span class="ignored"> </span><span class="hit"><xsl:when test="$text = 'one'"></span> | ||
09: <span class="ignored"> </span><span class="hit"><xsl:text></span><span class="hit">1</span><span class="hit"></xsl:text></span> | ||
10: <span class="ignored"> </span><span class="hit"></xsl:when></span> | ||
11: <span class="ignored"> </span><span class="missed"><xsl:otherwise></span><span class="ignored"> </span><span class="ignored"><!-- Expected miss --></span> | ||
12: <span class="ignored"> </span><span class="missed"><xsl:text></span><span class="missed">0</span><span class="missed"></xsl:text></span><span class="ignored"> </span><span class="ignored"><!-- Expected miss --></span> | ||
13: <span class="ignored"> </span><span class="missed"></xsl:otherwise></span><span class="ignored"> </span><span class="ignored"><!-- Expected miss --></span> | ||
14: <span class="ignored"> </span><span class="hit"></xsl:choose></span> | ||
15: <span class="ignored"> </span><span class="hit"></xsl:function></span> | ||
16: | ||
17: <span class="ignored"> </span><span class="hit"><xsl:function name="local:func-variable"></span> | ||
18: <span class="ignored"> </span><span class="hit"><xsl:param name="text" /></span> | ||
19: <span class="ignored"> </span><span class="hit"><xsl:variable name="normalizedText"></span> | ||
20: <span class="ignored"> </span><span class="hit"><xsl:value-of select="normalize-space($text)" /></span> | ||
21: <span class="ignored"> </span><span class="hit"></xsl:variable></span> | ||
22: <span class="ignored"> </span><span class="hit"><xsl:if test="$normalizedText = 'one'"></span> | ||
23: <span class="ignored"> </span><span class="hit"><xsl:text></span><span class="hit">1</span><span class="hit"></xsl:text></span> | ||
24: <span class="ignored"> </span><span class="hit"></xsl:if></span> | ||
25: <span class="ignored"> </span><span class="hit"><xsl:if test="$normalizedText != 'one'"></span> | ||
26: <span class="ignored"> </span><span class="missed"><xsl:text></span><span class="missed">0</span><span class="missed"></xsl:text></span><span class="ignored"> </span><span class="ignored"><!-- Expected miss --></span> | ||
27: <span class="ignored"> </span><span class="hit"></xsl:if></span> | ||
28: <span class="ignored"> </span><span class="hit"></xsl:function></span> | ||
29: <span class="ignored"></xsl:stylesheet></span></pre> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
test/end-to-end/cases-coverage/expected/stylesheet/issue-1917-variable-first-coverage.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<trace xspec="../../issue-1917-variable-first.xspec"> | ||
<compiled uri="issue-1917-variable-first-compiled.xsl"/> | ||
<module moduleId="0" uri="../../issue-1917.xsl"/> | ||
<traceable traceableId="0" | ||
class="net.sf.saxon.expr.instruct.UserFunction" | ||
uqname="Q{http://www.w3.org/1999/XSL/Transform}function"/> | ||
<hit lineNumber="17" columnNumber="44" moduleId="0" traceableId="0"/> | ||
<traceable traceableId="1" class="net.sf.saxon.expr.instruct.TraceExpression"/> | ||
<hit lineNumber="19" columnNumber="41" moduleId="0" traceableId="1"/> | ||
<hit lineNumber="22" columnNumber="44" moduleId="0" traceableId="1"/> | ||
<hit lineNumber="20" columnNumber="55" moduleId="0" traceableId="1"/> | ||
<hit lineNumber="20" columnNumber="55" moduleId="0" traceableId="1"/> | ||
<hit lineNumber="23" columnNumber="17" moduleId="0" traceableId="1"/> | ||
<hit lineNumber="25" columnNumber="45" moduleId="0" traceableId="1"/> | ||
<util utilId="0" uri="../../../../../src/common/report-sequence.xsl"/> | ||
<util utilId="1" uri="../../../../../src/common/common-utils.xsl"/> | ||
<util utilId="2" uri="../../../../../src/common/deep-equal.xsl"/> | ||
<hit lineNumber="5" columnNumber="42" moduleId="0" traceableId="0"/> | ||
<hit lineNumber="7" columnNumber="17" moduleId="0" traceableId="1"/> | ||
<hit lineNumber="9" columnNumber="19" moduleId="0" traceableId="1"/> | ||
</trace> |
21 changes: 21 additions & 0 deletions
21
test/end-to-end/cases-coverage/issue-1917-choose-first.xspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?xspec-test enable-coverage?> | ||
|
||
<x:description xmlns:x="http://www.jenitennison.com/xslt/xspec" | ||
xmlns:local="http://local/xslt" | ||
stylesheet="issue-1917.xsl"> | ||
|
||
<x:scenario label="func-choose"> | ||
<x:call function="local:func-choose"> | ||
<x:param>one</x:param> | ||
</x:call> | ||
<x:expect label="1 returned">1</x:expect> | ||
</x:scenario> | ||
|
||
<x:scenario label="func-variable"> | ||
<x:call function="local:func-variable"> | ||
<x:param>one</x:param> | ||
</x:call> | ||
<x:expect label="1 returned">1</x:expect> | ||
</x:scenario> | ||
</x:description> |
21 changes: 21 additions & 0 deletions
21
test/end-to-end/cases-coverage/issue-1917-variable-first.xspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?xspec-test enable-coverage?> | ||
|
||
<x:description xmlns:x="http://www.jenitennison.com/xslt/xspec" | ||
xmlns:local="http://local/xslt" | ||
stylesheet="issue-1917.xsl"> | ||
|
||
<x:scenario label="func-variable"> | ||
<x:call function="local:func-variable"> | ||
<x:param>one</x:param> | ||
</x:call> | ||
<x:expect label="1 returned">1</x:expect> | ||
</x:scenario> | ||
|
||
<x:scenario label="func-choose"> | ||
<x:call function="local:func-choose"> | ||
<x:param>one</x:param> | ||
</x:call> | ||
<x:expect label="1 returned">1</x:expect> | ||
</x:scenario> | ||
</x:description> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<xsl:stylesheet version="3.0" xmlns:local="http://local/xslt" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | ||
<xsl:output method="text" /> | ||
|
||
<xsl:function name="local:func-choose"> | ||
<xsl:param name="text" /> | ||
<xsl:choose> | ||
<xsl:when test="$text = 'one'"> | ||
<xsl:text>1</xsl:text> | ||
</xsl:when> | ||
<xsl:otherwise> <!-- Expected miss --> | ||
<xsl:text>0</xsl:text> <!-- Expected miss --> | ||
</xsl:otherwise> <!-- Expected miss --> | ||
</xsl:choose> | ||
</xsl:function> | ||
|
||
<xsl:function name="local:func-variable"> | ||
<xsl:param name="text" /> | ||
<xsl:variable name="normalizedText"> | ||
<xsl:value-of select="normalize-space($text)" /> | ||
</xsl:variable> | ||
<xsl:if test="$normalizedText = 'one'"> | ||
<xsl:text>1</xsl:text> | ||
</xsl:if> | ||
<xsl:if test="$normalizedText != 'one'"> | ||
<xsl:text>0</xsl:text> <!-- Expected miss --> | ||
</xsl:if> | ||
</xsl:function> | ||
</xsl:stylesheet> |