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

Allow context in named templates #76

Open
wants to merge 107 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
07c0c60
PR-76 issue #66 allow context in named templates
cirulls Feb 21, 2016
26a4292
Merge pull request #1 from cirulls/develop
Feb 21, 2016
b0b3001
expath#40 fix code coverage
Aug 10, 2016
91be55e
Merge branch 'develop'
Aug 10, 2016
4a26210
add Travis CI configuration
Aug 11, 2016
c2fdcad
add sudo required
Aug 11, 2016
daee7d5
install bats from GitHub
Aug 11, 2016
070cde7
# This is a combination of 4 commits.
Aug 14, 2016
3c40268
implement JUnit report (#2)
Aug 14, 2016
feb001c
replace saxon:serialize() with fn:serialize #81
Aug 17, 2016
07fdde6
add support for Saxon-9-1-0-8 (Saxon-B) #79
Aug 17, 2016
bc936b7
rename Saxon B jar file as per standard convention (#79)
Aug 17, 2016
df4959b
run tests with Travis CI (#5)
Aug 11, 2016
7e7199b
update link to Travis status page
Aug 21, 2016
6dc9376
add documentation
Aug 21, 2016
954a5ea
merge feature/junit into develop
Aug 21, 2016
0c7a0a0
Merge branch 'develop'
Aug 21, 2016
08cd006
update Travis config for master
Aug 21, 2016
4d82109
merge branch feature/saxon-b
Aug 21, 2016
1eb4b0c
Merge branch 'develop'
Aug 21, 2016
1a4377e
add XSLT 3.0 support #9 (#10)
Aug 29, 2016
cd47860
Merge branch 'develop'
Aug 29, 2016
116c49c
initial commit for bats test #12
Sep 29, 2016
65d9fc2
update Travis configuration #12
Sep 29, 2016
2b21942
test failing test #12
Sep 29, 2016
be28008
run only bats tests
Sep 29, 2016
7295cba
review bats test suite
Sep 29, 2016
8a41236
set TEST_DIR
Sep 29, 2016
86daf71
modify .travis
Sep 29, 2016
7e821e9
remove export in test without TEST_DIR
Sep 29, 2016
48b3dda
test failing tests
Sep 29, 2016
704b149
run XSpec test suite #12
Sep 29, 2016
46924d1
Fixed TEST_DIR management (#13)
c4s4 Sep 29, 2016
fab22d7
add output when test fails
Sep 29, 2016
7b0af25
update Travis configuration
Sep 29, 2016
f870574
override TEST_DIR when set and add bats test (#12 #13)
Sep 29, 2016
706b4e6
fix typo
Sep 29, 2016
53c2b7a
Merge branch 'develop'
Sep 29, 2016
7f3fef3
Fixed TEST_DIR management for winwdows (#14)
c4s4 Oct 17, 2016
63e1495
print message with location of HTML report (#16)
Oct 17, 2016
fdbcf4c
Bugfix/issue67 (#17)
Oct 30, 2016
7303f0d
Fix travis configuration #19
Dec 3, 2016
86e9bbf
use lazy evaluation to fix data type error (#24)
Dec 10, 2016
dcf41fd
reinstate copyright notes #23
Dec 10, 2016
8931b37
force to return the string value of node to support other data types …
Dec 12, 2016
670fcfe
retrieve saxon from maven repo (#34)
Dec 23, 2016
4449512
runner script for XSpec test suite does not detect compiling issues (…
Dec 27, 2016
5a44674
Fix regression bug introduced in v0.4.0-RC (#38)
Jan 1, 2017
70812b3
Revamp xspec.bat (#28)
AirQuick Jan 3, 2017
fe09541
Run tests on AppVeyor (#41)
AirQuick Jan 4, 2017
67461a0
test/xspec-junit.xspec fails with Saxon 9.6.0.10 (#40)
AirQuick Jan 4, 2017
5d6459b
Test with Saxon n and n-0.1 (#43)
AirQuick Jan 5, 2017
1a92c65
remove -j option in tests #39 (#49)
Jan 8, 2017
2a7057b
Run tests in Travis for both Saxon HE 9.7.0-14 and 9.6.0-7 (#45)
Jan 8, 2017
187f157
Always provide xs:boolean in $impl:successful expression (#48)
AirQuick Jan 8, 2017
ba5f97c
add bats test issue #46 / pr #48 (#51)
Jan 8, 2017
a6bb235
remove old references to xspec.googlecode.com #56
Jan 13, 2017
33684b7
remove old references to google repos #56 (#66)
Jan 14, 2017
82a3d49
Remove output and add directories to .gitignore (#65)
Jan 14, 2017
441eae6
Add tests for issue #46 / pr #48 for Windows (#54)
AirQuick Jan 14, 2017
5aa7644
update README and LICENSE files #52 (#53)
Jan 15, 2017
f2db6e4
Run tests with both Saxon 9.6.0-7 and 9.6.0-10 (#68)
tofi86 Jan 16, 2017
9b94529
Report all the basic types and valid numeric expressions (#58)
AirQuick Jan 19, 2017
01c7e25
Keep type annotations in $impl:test-items (#63)
AirQuick Feb 1, 2017
72a4c71
Run tests with Saxon 9.7.0-15 (#77)
AirQuick Feb 14, 2017
ad6b041
Revert harnesses to v0.3.0 and add UTF-8 encoding #74 #72 (#76)
Feb 16, 2017
bae9ce1
Consolidate cleanup tasks in batch script(#73)
AirQuick Mar 4, 2017
cd1908a
Highlight the link target (#79)
AirQuick Mar 4, 2017
ef2d44c
Run XProc test on AppVeyor (#86)
AirQuick Mar 7, 2017
f4811a5
Align Travis configuration with AppVeyor in #86 (#96)
Mar 7, 2017
a5ceb3a
Get the URLs back, adapted.
fgeorges Mar 7, 2017
a93e273
Fix indent.
fgeorges Mar 7, 2017
388c62e
Revive @assert and @context.
fgeorges Mar 7, 2017
74c9f0c
Merge branch 'master' of github.com:xspec/xspec
fgeorges Mar 7, 2017
8946ab5
revert to commit f4811a5 as tests are failing on master #97 (#101)
Mar 15, 2017
74312e1
add XProc harness for Saxon from v0.4.0 (#108)
Mar 15, 2017
2f71caa
Display result.log on test failure (#110)
AirQuick Mar 29, 2017
359b721
Update Saxon versions (#116)
AirQuick Apr 8, 2017
e99b5a2
Make XProc testing command lines more portable (#98)
AirQuick Apr 8, 2017
120b331
Separate common tests (for XSLT and XQuery) from generate-tests-utils…
AirQuick Apr 9, 2017
0ef7b8c
Added documentation for attributes in RNG schema (#115)
raducoravu Apr 10, 2017
cb4b235
Migrate test:tests to test/*.xspec (#118)
AirQuick Apr 10, 2017
701bd34
Stop using functx namespace (#104)
AirQuick Apr 16, 2017
a2b8e59
Do not copy unused namespaces from format utils to output (#91)
AirQuick Apr 16, 2017
9f28df6
xspec.bat (Windows) fails when path contains parentheses
AirQuick Apr 16, 2017
4e99c1d
Escape apostrophe in URI (#119)
Apr 17, 2017
942e26f
Run tests with XML Calabash 1.1.16-97 (#123)
AirQuick Apr 20, 2017
1101540
add checks for saxon script + test (#124)
Apr 22, 2017
6b6d07b
add Schematron support (#105)
vincentml May 4, 2017
e318391
Add documentation for Schematron support (#129)
May 25, 2017
436ceb0
add XProc harness for BaseX standalone (review #103) (#136)
Jun 10, 2017
c25a849
From pull request #129 discussion: suppress warning message and clean…
vincentml Jun 26, 2017
a602c4b
Allow Schematron XSLTs to be provided externally (#133)
vincentml Jun 26, 2017
a032c19
End-to-end test for XSpec itself (#81)
AirQuick Aug 29, 2017
73aa6f9
Add TODO comments for focus/pending tests in #4 (#61)
AirQuick Aug 30, 2017
cc3a18b
Run tests with latest Saxon HE 9.7 maintenance release (9.7.0.20) (#146)
AirQuick Aug 31, 2017
9608693
Add end-to-end tests for testing failing and pending functionalities
AirQuick Oct 1, 2017
5f2cf8c
Remove JAVA_OPTIONS message from output in Travis (#148)
Oct 1, 2017
4031674
Replace regression tests for #50 and #55 as end-to-end tests (#145)
AirQuick Oct 1, 2017
7205f22
Balisage improvements to Schematron support (#149)
vincentml Nov 6, 2017
78f63a6
Run tests with Saxon 9.8.0.7, 9.7.0.21 and 9.7.0.19 (#157)
AirQuick Dec 28, 2017
c76d4fd
Improvements to HTML report (#135)
vincentml Jan 7, 2018
ffd5eda
Add tests for CSS inline (#159)
Jan 24, 2018
63cf95d
Add Ant build support for Schematron (#160)
Feb 4, 2018
c9fdb91
Add a pom file to publish XSpec as a Maven artifact (#156)
cmarchand Mar 18, 2018
b5707e9
Include path to the test source files in all report formats (#188)
vincentml Apr 2, 2018
0e21fca
Enhance coverage-report.xsl to be able to specify css location (#194)
cmarchand Apr 9, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
run tests with Travis CI (#5)
Sandro Cirulli committed Aug 21, 2016
commit df4959b87cf8054ca4ad8b6d17b627c233dff659
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,14 @@ before_script:
- mkdir -p /tmp/local
- bash /tmp/bats/install.sh /tmp/local
- export PATH=$PATH:/tmp/local/bin
- git clone -b travis https://github.com/cirulls/xspec.git /tmp/xspec
- export SAXON_CP=/tmp/xspec/saxon9he.jar

script:
- bats test/xspec.bats
- echo "execute bats unit tests"
- cd test && bats xspec.bats

script:
- echo "execute XSpec unit tests"
- cd test && ./run-xspec-tests.sh
# - /tmp/xspec/bin/xspec.sh /tmp/xspec/test/xspec-variable.xspec &> result.log && if grep -q ".*failed:\s[1-9]" result.log; then exit 1; fi
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![Travis Build Status](https://api.travis-ci.org/cirulls/xspec.svg?branch=travis "Travis Build Status")

## XSpec

Version 0.4.0.
Binary file added saxon9he.jar
Binary file not shown.
8 changes: 8 additions & 0 deletions test/run-xspec-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# run it inside test directory
for xspectest in *.xspec;
do ../bin/xspec.sh $xspectest &> result.log;
if grep -q ".*failed:\s[1-9]" result.log;
then echo "$xspectest failed" && exit 1;
fi
done
79 changes: 32 additions & 47 deletions test/xspec-focus-1.xspec
Original file line number Diff line number Diff line change
@@ -6,60 +6,45 @@
<!-- Tags: -->
<!-- Copyright (c) 2010 Jeni Tennsion (see end of file.) -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


<t:description xmlns:t="http://www.jenitennison.com/xslt/xspec"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:my="http://example.org/ns/my"
query="http://example.org/ns/my"
query-at="xspec-tested.xql"
stylesheet="xspec-tested.xsl">

<!--
<t:description xmlns:t="http://www.jenitennison.com/xslt/xspec" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:my="http://example.org/ns/my" query="http://example.org/ns/my" query-at="xspec-tested.xql" stylesheet="xspec-tested.xsl">
<!--
Test @focus.
-->

<!--
<!--
Normal scenarios (must be pending because of the @focus).
-->
<t:scenario label="pending call">
<t:call function="my:square">
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<t:scenario label="pending must fail">
<t:call function="my:square">
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of xs:string"/>
<t:expect label="the type" assert="$x:result instance of xs:string"/>
</t:scenario>

<!--
<t:scenario label="pending call" focus="focus">
<t:call function="my:square">
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>
<t:scenario label="pending must fail">
<t:call function="my:square">
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of xs:string"/>
<t:expect label="the type" assert="$x:result instance of xs:string"/>
</t:scenario>
<!--
Focused on scenarios.
-->
<t:scenario label="focus call" focus="focus">
<t:call function="my:square">
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<t:scenario label="focus must fail" focus="focus">
<t:call function="my:square">
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of xs:string"/>
<t:expect label="the type" assert="$x:result instance of xs:string"/>
</t:scenario>

<t:scenario label="focus call" focus="focus">
<t:call function="my:square">
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>
<t:scenario label="focus must fail">
<t:call function="my:square">
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of xs:string"/>
<t:expect label="the type" assert="$x:result instance of xs:string"/>
</t:scenario>
</t:description>


<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. -->
<!-- -->
46 changes: 17 additions & 29 deletions test/xspec-function.xspec
Original file line number Diff line number Diff line change
@@ -6,37 +6,25 @@
<!-- Tags: -->
<!-- Copyright (c) 2010 Jeni Tennsion (see end of file.) -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


<?oxygen RNGSchema="http://xspec.googlecode.com/svn/trunk/xspec.rnc" type="compact"?>

<t:description xmlns:t="http://www.jenitennison.com/xslt/xspec"
xmlns:my="http://example.org/ns/my"
query="http://example.org/ns/my"
query-at="xspec-tested.xql"
stylesheet="xspec-tested.xsl">

<t:scenario label="call">
<t:call function="my:square">
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the type" test="$x:result instance of xs:integer"/>
<t:expect label="the result" assert="$x:result eq 9"/>
<t:expect label="the type" assert="$x:result instance of xs:integer"/>
</t:scenario>

<t:scenario label="must fail">
<t:call function="my:square">
<t:param select="2"/>
</t:call>
<t:expect label="wrong result" test="$x:result eq 42"/>
<t:expect label="wrong result" assert="$x:result eq 42"/>
</t:scenario>

<t:description xmlns:t="http://www.jenitennison.com/xslt/xspec" xmlns:my="http://example.org/ns/my" query="http://example.org/ns/my" query-at="xspec-tested.xql" stylesheet="xspec-tested.xsl">
<t:scenario label="call" focus="focus">
<t:call function="my:square">
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the type" test="$x:result instance of xs:integer"/>
<t:expect label="the result" assert="$x:result eq 9"/>
<t:expect label="the type" assert="$x:result instance of xs:integer"/>
</t:scenario>
<t:scenario label="must fail">
<t:call function="my:square">
<t:param select="2"/>
</t:call>
<t:expect label="wrong result" test="$x:result eq 42"/>
<t:expect label="wrong result" assert="$x:result eq 42"/>
</t:scenario>
</t:description>


<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. -->
<!-- -->
42 changes: 15 additions & 27 deletions test/xspec-imported.xspec
Original file line number Diff line number Diff line change
@@ -6,35 +6,23 @@
<!-- Tags: -->
<!-- Copyright (c) 2010 Jeni Tennsion (see end of file.) -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


<?oxygen RNGSchema="http://xspec.googlecode.com/svn/trunk/xspec.rnc" type="compact"?>

<t:description xmlns:t="http://www.jenitennison.com/xslt/xspec"
xmlns:my="http://example.org/ns/my"
query="http://example.org/ns/my"
query-at="xspec-tested.xql"
stylesheet="xspec-tested.xsl">

<t:scenario label="call">
<t:call function="my:square">
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<t:scenario label="must fail">
<t:call function="my:square">
<t:param select="2"/>
</t:call>
<t:expect label="wrong result" test="$x:result eq 42"/>
<t:expect label="wrong result" assert="$x:result eq 42"/>
</t:scenario>

<t:description xmlns:t="http://www.jenitennison.com/xslt/xspec" xmlns:my="http://example.org/ns/my" query="http://example.org/ns/my" query-at="xspec-tested.xql" stylesheet="xspec-tested.xsl">
<t:scenario label="call" focus="focus">
<t:call function="my:square">
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>
<t:scenario label="must fail">
<t:call function="my:square">
<t:param select="2"/>
</t:call>
<t:expect label="wrong result" test="$x:result eq 42"/>
<t:expect label="wrong result" assert="$x:result eq 42"/>
</t:scenario>
</t:description>


<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. -->
<!-- -->
106 changes: 43 additions & 63 deletions test/xspec-pending.xspec
Original file line number Diff line number Diff line change
@@ -6,85 +6,65 @@
<!-- Tags: -->
<!-- Copyright (c) 2010 Jeni Tennsion (see end of file.) -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


<?oxygen RNGSchema="http://xspec.googlecode.com/svn/trunk/xspec.rnc" type="compact"?>

<t:description xmlns:t="http://www.jenitennison.com/xslt/xspec"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:my="http://example.org/ns/my"
query="http://example.org/ns/my"
query-at="xspec-tested.xql"
stylesheet="xspec-tested.xsl">

<!--
<t:description xmlns:t="http://www.jenitennison.com/xslt/xspec" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:my="http://example.org/ns/my" query="http://example.org/ns/my" query-at="xspec-tested.xql" stylesheet="xspec-tested.xsl">
<!--
Test pending features (x:pending and @pending).
-->

<!--
<!--
Test x:pending.
-->
<t:pending label="testing pending element">

<t:scenario label="pending call (element)">
<t:call function="my:square">
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<t:scenario label="pending must fail (element)">
<t:call function="my:square">
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of xs:string"/>
<t:expect label="the type" assert="$x:result instance of xs:string"/>
</t:scenario>

</t:pending>

<!--
Non-pending scenarios.
-->
<t:scenario label="call">
<t:pending label="testing pending element">
<t:scenario label="pending call (element)">
<t:call function="my:square">
<t:param select="3"/>
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<t:scenario label="must fail">
</t:scenario>
<t:scenario label="pending must fail (element)">
<t:call function="my:square">
<t:param select="2"/>
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of xs:string"/>
<t:expect label="the type" assert="$x:result instance of xs:string"/>
</t:scenario>

<!--
</t:scenario>
</t:pending>
<!--
Non-pending scenarios.
-->
<t:scenario label="call" focus="focus">
<t:call function="my:square">
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>
<t:scenario label="must fail">
<t:call function="my:square">
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of xs:string"/>
<t:expect label="the type" assert="$x:result instance of xs:string"/>
</t:scenario>
<!--
Test @pending.
-->
<t:scenario label="pending call (attribute)" pending="testing pending attribute">
<t:call function="my:square">
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<t:scenario label="pending must fail (attribute)" pending="testing pending attribute">
<t:call function="my:square">
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of xs:string"/>
<t:expect label="the type" assert="$x:result instance of xs:string"/>
</t:scenario>

<t:scenario label="pending call (attribute)" pending="testing pending attribute">
<t:call function="my:square">
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>
<t:scenario label="pending must fail (attribute)" pending="testing pending attribute">
<t:call function="my:square">
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of xs:string"/>
<t:expect label="the type" assert="$x:result instance of xs:string"/>
</t:scenario>
</t:description>


<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. -->
<!-- -->
91 changes: 40 additions & 51 deletions test/xspec-rule.xspec
Original file line number Diff line number Diff line change
@@ -6,59 +6,48 @@
<!-- Tags: -->
<!-- Copyright (c) 2010 Jeni Tennsion (see end of file.) -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


<?oxygen RNGSchema="http://xspec.googlecode.com/svn/trunk/xspec.rnc" type="compact"?>

<t:description xmlns:t="http://www.jenitennison.com/xslt/xspec"
stylesheet="xspec-tested.xsl">

<t:scenario label="context">
<t:context>
<rule/>
</t:context>
<t:expect label="the result">
<transformed/>
</t:expect>
</t:scenario>

<t:scenario label="context result is wrong: must fail">
<t:context>
<rule/>
</t:context>
<t:expect label="wrong result">
<erroneous/>
</t:expect>
</t:scenario>

<!-- TODO: Make two different cases for the base t:apply and with param. -->
<t:scenario label="apply" pending="not implemented yet">
<t:variable name="ctxt" as="element()">
<rule/>
</t:variable>
<t:apply select="$ctxt">
<t:param name="p" select="0"/>
</t:apply>
<t:expect label="the result">
<transformed/>
</t:expect>
</t:scenario>

<t:scenario label="apply result is wrong: must fail" pending="not implemented yet">
<t:variable name="ctxt" as="element()">
<rule/>
</t:variable>
<t:apply select="$ctxt">
<t:param name="p" select="0"/>
</t:apply>
<t:expect label="wrong result">
<erroneous/>
</t:expect>
</t:scenario>

<t:description xmlns:t="http://www.jenitennison.com/xslt/xspec" stylesheet="xspec-tested.xsl">
<t:scenario label="context">
<t:context>
<rule/>
</t:context>
<t:expect label="the result">
<transformed/>
</t:expect>
</t:scenario>
<t:scenario label="context result is wrong: must fail" pending="should be rewritten">
<t:context>
<rule/>
</t:context>
<t:expect label="wrong result">
<erroneous/>
</t:expect>
</t:scenario>
<!-- TODO: Make two different cases for the base t:apply and with param. -->
<t:scenario label="apply" pending="not implemented yet">
<t:variable name="ctxt" as="element()">
<rule/>
</t:variable>
<t:apply select="$ctxt">
<t:param name="p" select="0"/>
</t:apply>
<t:expect label="the result">
<transformed/>
</t:expect>
</t:scenario>
<t:scenario label="apply result is wrong: must fail" pending="not implemented yet">
<t:variable name="ctxt" as="element()">
<rule/>
</t:variable>
<t:apply select="$ctxt">
<t:param name="p" select="0"/>
</t:apply>
<t:expect label="wrong result">
<erroneous/>
</t:expect>
</t:scenario>
</t:description>


<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT. -->
<!-- -->
11 changes: 7 additions & 4 deletions test/xspec.bats
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
#
# AUTHOR: Sandro Cirulli, github.com/cirulls
#
# LICENSE: GNU GPL v3
# LICENSE: MIT License
#
#===============================================================================

@@ -64,17 +64,20 @@
}


# this test must run first to create xspec directory
@test "invoking code coverage with Saxon9EE creates test stylesheet" {
export SAXON_CP=/path/to/saxon9ee.jar
run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
[ "$status" -eq 1 ]
[ "${lines[1]}" = "Creating Test Stylesheet..." ]
[ "${lines[2]}" = "Creating Test Stylesheet..." ]
}


@test "invoking code coverage with Saxon9PE creates test stylesheet" {
export SAXON_CP=/path/to/saxon9ee.jar
export SAXON_CP=/path/to/saxon9pe.jar
pwd
ls -lah ../tutorial
run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
echo ${lines[1]}
[ "$status" -eq 1 ]
[ "${lines[1]}" = "Creating Test Stylesheet..." ]
}
88 changes: 88 additions & 0 deletions test/xspec/xspec-junit-result.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?><html xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Test Report for home/sandro/Documents/programming/github/cirulls/xspec/src/reporter/junit-report.xsl (3/0/0/3)</title>
<link rel="stylesheet" type="text/css" href="file:/home/sandro/Documents/programming/github/cirulls/xspec/src/reporter/test-report.css" />
</head>
<body>
<h1>Test Report</h1>
<p>Stylesheet: <a href="file:/home/sandro/Documents/programming/github/cirulls/xspec/src/reporter/junit-report.xsl">home/sandro/Documents/programming/github/cirulls/xspec/src/reporter/junit-report.xsl</a></p>
<p>Tested: 17 August 2016 at 20:23</p>
<h2>Contents</h2>
<table class="xspec">
<col width="85%" />
<col width="15%" />
<thead>
<tr>
<th style="text-align: right; font-weight: normal; ">passed/pending/failed/total</th>
<th>3/0/0/3</th>
</tr>
</thead>
<tbody>
<tr class="successful">
<th><a href="#d3e4">When processing a successful test</a></th>
<th>1/0/0/1</th>
</tr>
<tr class="successful">
<th><a href="#d3e52">When processing a failing test</a></th>
<th>1/0/0/1</th>
</tr>
<tr class="successful">
<th><a href="#d3e112">When processing successful and failing tests</a></th>
<th>1/0/0/1</th>
</tr>
</tbody>
</table>
<div id="d3e4">
<h2 class="successful">When processing a successful test<span class="scenario-totals">1/0/0/1</span></h2>
<table class="xspec" id="t-d3e4">
<col width="85%" />
<col width="15%" />
<tbody>
<tr class="successful">
<th>When processing a successful test</th>
<th>1/0/0/1</th>
</tr>
<tr class="successful">
<td>convert it to test case with status passed</td>
<td>Success</td>
</tr>
</tbody>
</table>
</div>
<div id="d3e52">
<h2 class="successful">When processing a failing test<span class="scenario-totals">1/0/0/1</span></h2>
<table class="xspec" id="t-d3e52">
<col width="85%" />
<col width="15%" />
<tbody>
<tr class="successful">
<th>When processing a failing test</th>
<th>1/0/0/1</th>
</tr>
<tr class="successful">
<td>convert it to test case with status failed</td>
<td>Success</td>
</tr>
</tbody>
</table>
</div>
<div id="d3e112">
<h2 class="successful">When processing successful and failing tests<span class="scenario-totals">1/0/0/1</span></h2>
<table class="xspec" id="t-d3e112">
<col width="85%" />
<col width="15%" />
<tbody>
<tr class="successful">
<th>When processing successful and failing tests</th>
<th>1/0/0/1</th>
</tr>
<tr class="successful">
<td>convert it to test cases with status passed and failing</td>
<td>Success</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
111 changes: 111 additions & 0 deletions test/xspec/xspec-junit-result.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="file:/home/sandro/Documents/programming/github/cirulls/xspec/src/compiler/format-xspec-report.xsl"?>
<x:report xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:test="http://www.jenitennison.com/xslt/unit-test"
xmlns:x="http://www.jenitennison.com/xslt/xspec"
stylesheet="file:/home/sandro/Documents/programming/github/cirulls/xspec/src/reporter/junit-report.xsl"
date="2016-08-17T20:23:05.17+01:00">
<x:scenario>
<x:label>When processing a successful test</x:label>
<x:context>
<x:test successful="true">
<x:label>Successful test</x:label>
<x:result>
<p>Foo</p>
</x:result>
<x:expect>
<p>Foo</p>
</x:expect>
</x:test>
</x:context>
<x:result>
<testcase name="Successful test" status="passed"/>
</x:result>
<x:test successful="true">
<x:label>convert it to test case with status passed</x:label>
<x:result>
<testcase name="Successful test" status="passed"/>
</x:result>
<x:expect>
<testcase name="Successful test" status="passed"/>
</x:expect>
</x:test>
</x:scenario>
<x:scenario>
<x:label>When processing a failing test</x:label>
<x:context>
<x:test successful="false">
<x:label>failing test</x:label>
<x:result>
<p>Foo</p>
</x:result>
<x:expect>
<p>Bar</p>
</x:expect>
</x:test>
</x:context>
<x:result>
<testcase name="failing test" status="failed">
<failure message="expect assertion failed">&lt;x:expect xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:x="http://www.jenitennison.com/xslt/xspec"&gt;&lt;p&gt;Bar&lt;/p&gt;&lt;/x:expect&gt;</failure>
</testcase>
</x:result>
<x:test successful="true">
<x:label>convert it to test case with status failed</x:label>
<x:result>
<testcase name="failing test" status="failed">
<failure message="expect assertion failed">&lt;x:expect xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:x="http://www.jenitennison.com/xslt/xspec"&gt;&lt;p&gt;Bar&lt;/p&gt;&lt;/x:expect&gt;</failure>
</testcase>
</x:result>
<x:expect>
<testcase name="failing test" status="failed">
<failure message="expect assertion failed">&lt;x:expect xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:x="http://www.jenitennison.com/xslt/xspec"&gt;&lt;p&gt;Bar&lt;/p&gt;&lt;/x:expect&gt;</failure>
</testcase>
</x:expect>
</x:test>
</x:scenario>
<x:scenario>
<x:label>When processing successful and failing tests</x:label>
<x:context>
<x:test successful="true">
<x:label>Successful test</x:label>
<x:result>
<p>Foo</p>
</x:result>
<x:expect>
<p>Foo</p>
</x:expect>
</x:test>
<x:test successful="false">
<x:label>Failing test</x:label>
<x:result>
<p>Foo</p>
</x:result>
<x:expect>
<p>Bar</p>
</x:expect>
</x:test>
</x:context>
<x:result>
<testcase name="Successful test" status="passed"/>
<testcase name="Failing test" status="failed">
<failure message="expect assertion failed">&lt;x:expect xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:x="http://www.jenitennison.com/xslt/xspec"&gt;&lt;p&gt;Bar&lt;/p&gt;&lt;/x:expect&gt;</failure>
</testcase>
</x:result>
<x:test successful="true">
<x:label>convert it to test cases with status passed and failing</x:label>
<x:result>
<testcase name="Successful test" status="passed"/>
<testcase name="Failing test" status="failed">
<failure message="expect assertion failed">&lt;x:expect xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:x="http://www.jenitennison.com/xslt/xspec"&gt;&lt;p&gt;Bar&lt;/p&gt;&lt;/x:expect&gt;</failure>
</testcase>
</x:result>
<x:expect>
<testcase name="Successful test" status="passed"/>
<testcase name="Failing test" status="failed">
<failure message="expect assertion failed">&lt;x:expect xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:x="http://www.jenitennison.com/xslt/xspec"&gt;&lt;p&gt;Bar&lt;/p&gt;&lt;/x:expect&gt;</failure>
</testcase>
</x:expect>
</x:test>
</x:scenario>
</x:report>
352 changes: 352 additions & 0 deletions test/xspec/xspec-junit.xsl

Large diffs are not rendered by default.

75 changes: 75 additions & 0 deletions test/xspec/xspec-variable-result.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?><html xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Test Report for home/sandro/Documents/programming/github/cirulls/xspec/test/xspec-tested.xsl (4/0/0/4)</title>
<link rel="stylesheet" type="text/css" href="file:/home/sandro/Documents/programming/github/cirulls/xspec/src/reporter/test-report.css" />
</head>
<body>
<h1>Test Report</h1>
<p>Stylesheet: <a href="file:/home/sandro/Documents/programming/github/cirulls/xspec/test/xspec-tested.xsl">home/sandro/Documents/programming/github/cirulls/xspec/test/xspec-tested.xsl</a></p>
<p>Tested: 11 August 2016 at 23:20</p>
<h2>Contents</h2>
<table class="xspec">
<col width="85%" />
<col width="15%" />
<thead>
<tr>
<th style="text-align: right; font-weight: normal; ">passed/pending/failed/total</th>
<th>4/0/0/4</th>
</tr>
</thead>
<tbody>
<tr class="successful">
<th><a href="#d3e4">call global var</a></th>
<th>2/0/0/2</th>
</tr>
<tr class="successful">
<th><a href="#d3e33">call local var</a></th>
<th>2/0/0/2</th>
</tr>
</tbody>
</table>
<div id="d3e4">
<h2 class="successful">call global var<span class="scenario-totals">2/0/0/2</span></h2>
<table class="xspec" id="t-d3e4">
<col width="85%" />
<col width="15%" />
<tbody>
<tr class="successful">
<th>call global var</th>
<th>2/0/0/2</th>
</tr>
<tr class="successful">
<td>the result</td>
<td>Success</td>
</tr>
<tr class="successful">
<td>the result</td>
<td>Success</td>
</tr>
</tbody>
</table>
</div>
<div id="d3e33">
<h2 class="successful">call local var<span class="scenario-totals">2/0/0/2</span></h2>
<table class="xspec" id="t-d3e33">
<col width="85%" />
<col width="15%" />
<tbody>
<tr class="successful">
<th>call local var</th>
<th>2/0/0/2</th>
</tr>
<tr class="successful">
<td>the result</td>
<td>Success</td>
</tr>
<tr class="successful">
<td>the result</td>
<td>Success</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
41 changes: 41 additions & 0 deletions test/xspec/xspec-variable-result.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="file:/home/sandro/Documents/programming/github/cirulls/xspec/src/compiler/format-xspec-report.xsl"?>
<x:report xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:test="http://www.jenitennison.com/xslt/unit-test"
xmlns:x="http://www.jenitennison.com/xslt/xspec"
xmlns:t="http://www.jenitennison.com/xslt/xspec"
xmlns:my="http://example.org/ns/my"
stylesheet="file:/home/sandro/Documents/programming/github/cirulls/xspec/test/xspec-tested.xsl"
date="2016-08-11T23:20:04.105+01:00">
<x:scenario>
<x:label>call global var</x:label>
<x:call function="my:square">
<x:param select="$test-3/@num"/>
</x:call>
<x:result select="9"/>
<x:test successful="true">
<x:label>the result</x:label>
<x:result select="9"/>
</x:test>
<x:test successful="true">
<x:label>the result</x:label>
<x:result select="9"/>
</x:test>
</x:scenario>
<x:scenario>
<x:label>call local var</x:label>
<x:call function="my:square">
<x:param select="$param"/>
</x:call>
<x:result select="9"/>
<x:test successful="true">
<x:label>the result</x:label>
<x:result select="9"/>
</x:test>
<x:test successful="true">
<x:label>the result</x:label>
<x:result select="9"/>
</x:test>
</x:scenario>
</x:report>
276 changes: 276 additions & 0 deletions test/xspec/xspec-variable.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:test="http://www.jenitennison.com/xslt/unit-test"
xmlns:x="http://www.jenitennison.com/xslt/xspec"
xmlns:__x="http://www.w3.org/1999/XSL/TransformAliasAlias"
xmlns:pkg="http://expath.org/ns/pkg"
xmlns:impl="urn:x-xspec:compile:xslt:impl"
xmlns:t="http://www.jenitennison.com/xslt/xspec"
xmlns:my="http://example.org/ns/my"
version="2.0"
exclude-result-prefixes="pkg impl">
<xsl:import href="file:/home/sandro/Documents/programming/github/cirulls/xspec/test/xspec-tested.xsl"/>
<xsl:import href="file:/home/sandro/Documents/programming/github/cirulls/xspec/src/compiler/generate-tests-utils.xsl"/>
<xsl:namespace-alias stylesheet-prefix="__x" result-prefix="xsl"/>
<xsl:variable name="x:stylesheet-uri"
as="xs:string"
select="'file:/home/sandro/Documents/programming/github/cirulls/xspec/test/xspec-tested.xsl'"/>
<xsl:output name="x:report" method="xml" indent="yes"/>
<xsl:variable name="test-data-doc"
as="document-node()"
select="doc('file:/home/sandro/Documents/programming/github/cirulls/xspec/test/xspec-variable.xml')"/>
<xsl:variable name="test-data" select="$test-data-doc"/>
<xsl:variable select="$test-data/*/test[xs:integer(@num) eq 3]" name="test-3"/>
<xsl:template name="x:main">
<xsl:message>
<xsl:text>Testing with </xsl:text>
<xsl:value-of select="system-property('xsl:product-name')"/>
<xsl:text> </xsl:text>
<xsl:value-of select="system-property('xsl:product-version')"/>
</xsl:message>
<xsl:result-document format="x:report">
<xsl:processing-instruction name="xml-stylesheet">type="text/xsl" href="file:/home/sandro/Documents/programming/github/cirulls/xspec/src/compiler/format-xspec-report.xsl"</xsl:processing-instruction>
<x:report stylesheet="{$x:stylesheet-uri}" date="{current-dateTime()}">
<xsl:call-template name="x:d5e4"/>
<xsl:call-template name="x:d5e10"/>
</x:report>
</xsl:result-document>
</xsl:template>
<xsl:template name="x:d5e4">
<xsl:message>call global var</xsl:message>
<x:scenario>
<x:label>call global var</x:label>
<x:call function="my:square">
<x:param select="$test-3/@num"/>
</x:call>
<xsl:variable name="x:result" as="item()*">
<xsl:variable select="$test-3/@num" name="d6e1"/>
<xsl:sequence select="my:square($d6e1)"/>
</xsl:variable>
<xsl:call-template name="test:report-value">
<xsl:with-param name="value" select="$x:result"/>
<xsl:with-param name="wrapper-name" select="'x:result'"/>
<xsl:with-param name="wrapper-ns" select="'http://www.jenitennison.com/xslt/xspec'"/>
</xsl:call-template>
<xsl:call-template name="x:d5e7">
<xsl:with-param name="x:result" select="$x:result"/>
</xsl:call-template>
<xsl:call-template name="x:d5e8">
<xsl:with-param name="x:result" select="$x:result"/>
</xsl:call-template>
</x:scenario>
</xsl:template>
<xsl:template name="x:d5e7">
<xsl:param name="x:result" required="yes"/>
<xsl:message>the result</xsl:message>
<xsl:variable name="impl:just-nodes"
select=" $x:result instance of node()+"/>
<xsl:variable name="impl:with-context"
select=" exists($x:result) and empty($x:result[2]) or $impl:just-nodes"/>
<xsl:variable name="impl:context" as="item()?">
<xsl:choose>
<xsl:when test="$impl:just-nodes">
<xsl:document>
<xsl:sequence select="$x:result"/>
</xsl:document>
</xsl:when>
<xsl:when test="$impl:with-context">
<xsl:sequence select="$x:result"/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:variable>
<xsl:variable name="impl:assert" as="item()*">
<xsl:choose>
<xsl:when test="$impl:with-context">
<xsl:for-each select="$impl:context">
<xsl:sequence select="$x:result eq $test-3/xs:integer(@value)"/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="$x:result eq $test-3/xs:integer(@value)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="not($impl:assert instance of xs:boolean)">
<xsl:message terminate="yes">ERROR in scenario "the result": @assert|@test did not return a boolean</xsl:message>
</xsl:if>
<xsl:variable name="impl:successful" as="xs:boolean" select="$impl:assert"/>
<xsl:if test="not($impl:successful)">
<xsl:message> FAILED</xsl:message>
</xsl:if>
<x:test successful="{ $impl:successful }">
<x:label>the result</x:label>
<xsl:call-template name="test:report-value">
<xsl:with-param name="value" select="$x:result"/>
<xsl:with-param name="wrapper-name" select="'x:result'"/>
<xsl:with-param name="wrapper-ns" select="'http://www.jenitennison.com/xslt/xspec'"/>
</xsl:call-template>
</x:test>
</xsl:template>
<xsl:template name="x:d5e8">
<xsl:param name="x:result" required="yes"/>
<xsl:message>the result</xsl:message>
<xsl:variable name="impl:with-context"
select=" exists($x:result) and empty($x:result[2])"/>
<xsl:variable name="impl:context" as="item()?">
<xsl:choose>
<xsl:when test="$impl:with-context">
<xsl:sequence select="$x:result"/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:variable>
<xsl:variable name="impl:assert" as="item()*">
<xsl:choose>
<xsl:when test="$impl:with-context">
<xsl:for-each select="$impl:context">
<xsl:sequence select="$x:result eq $test-3/xs:integer(@value)"/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="$x:result eq $test-3/xs:integer(@value)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="not($impl:assert instance of xs:boolean)">
<xsl:message terminate="yes">ERROR in scenario "the result": @assert|@test did not return a boolean</xsl:message>
</xsl:if>
<xsl:variable name="impl:successful" as="xs:boolean" select="$impl:assert"/>
<xsl:if test="not($impl:successful)">
<xsl:message> FAILED</xsl:message>
</xsl:if>
<x:test successful="{ $impl:successful }">
<x:label>the result</x:label>
<xsl:call-template name="test:report-value">
<xsl:with-param name="value" select="$x:result"/>
<xsl:with-param name="wrapper-name" select="'x:result'"/>
<xsl:with-param name="wrapper-ns" select="'http://www.jenitennison.com/xslt/xspec'"/>
</xsl:call-template>
</x:test>
</xsl:template>
<xsl:template name="x:d5e10">
<xsl:message>call local var</xsl:message>
<x:scenario>
<x:label>call local var</x:label>
<x:call function="my:square">
<x:param select="$param"/>
</x:call>
<xsl:variable select="$test-3/@num" name="param"/>
<xsl:variable name="x:result" as="item()*">
<xsl:variable select="$param" name="d18e1"/>
<xsl:sequence select="my:square($d18e1)"/>
</xsl:variable>
<xsl:call-template name="test:report-value">
<xsl:with-param name="value" select="$x:result"/>
<xsl:with-param name="wrapper-name" select="'x:result'"/>
<xsl:with-param name="wrapper-ns" select="'http://www.jenitennison.com/xslt/xspec'"/>
</xsl:call-template>
<xsl:variable select="$test-3/@value" name="result"/>
<xsl:call-template name="x:d5e15">
<xsl:with-param name="x:result" select="$x:result"/>
<xsl:with-param name="param" select="$param"/>
<xsl:with-param name="result" select="$result"/>
</xsl:call-template>
<xsl:call-template name="x:d5e16">
<xsl:with-param name="x:result" select="$x:result"/>
<xsl:with-param name="param" select="$param"/>
<xsl:with-param name="result" select="$result"/>
</xsl:call-template>
</x:scenario>
</xsl:template>
<xsl:template name="x:d5e15">
<xsl:param name="x:result" required="yes"/>
<xsl:param name="param" required="yes"/>
<xsl:param name="result" required="yes"/>
<xsl:message>the result</xsl:message>
<xsl:variable name="impl:just-nodes"
select=" $x:result instance of node()+"/>
<xsl:variable name="impl:with-context"
select=" exists($x:result) and empty($x:result[2]) or $impl:just-nodes"/>
<xsl:variable name="impl:context" as="item()?">
<xsl:choose>
<xsl:when test="$impl:just-nodes">
<xsl:document>
<xsl:sequence select="$x:result"/>
</xsl:document>
</xsl:when>
<xsl:when test="$impl:with-context">
<xsl:sequence select="$x:result"/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:variable>
<xsl:variable name="impl:assert" as="item()*">
<xsl:choose>
<xsl:when test="$impl:with-context">
<xsl:for-each select="$impl:context">
<xsl:sequence select="$x:result eq xs:integer($result)"/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="$x:result eq xs:integer($result)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="not($impl:assert instance of xs:boolean)">
<xsl:message terminate="yes">ERROR in scenario "the result": @assert|@test did not return a boolean</xsl:message>
</xsl:if>
<xsl:variable name="impl:successful" as="xs:boolean" select="$impl:assert"/>
<xsl:if test="not($impl:successful)">
<xsl:message> FAILED</xsl:message>
</xsl:if>
<x:test successful="{ $impl:successful }">
<x:label>the result</x:label>
<xsl:call-template name="test:report-value">
<xsl:with-param name="value" select="$x:result"/>
<xsl:with-param name="wrapper-name" select="'x:result'"/>
<xsl:with-param name="wrapper-ns" select="'http://www.jenitennison.com/xslt/xspec'"/>
</xsl:call-template>
</x:test>
</xsl:template>
<xsl:template name="x:d5e16">
<xsl:param name="x:result" required="yes"/>
<xsl:param name="param" required="yes"/>
<xsl:param name="result" required="yes"/>
<xsl:message>the result</xsl:message>
<xsl:variable name="impl:with-context"
select=" exists($x:result) and empty($x:result[2])"/>
<xsl:variable name="impl:context" as="item()?">
<xsl:choose>
<xsl:when test="$impl:with-context">
<xsl:sequence select="$x:result"/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:variable>
<xsl:variable name="impl:assert" as="item()*">
<xsl:choose>
<xsl:when test="$impl:with-context">
<xsl:for-each select="$impl:context">
<xsl:sequence select="$x:result eq xs:integer($result)"/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="$x:result eq xs:integer($result)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="not($impl:assert instance of xs:boolean)">
<xsl:message terminate="yes">ERROR in scenario "the result": @assert|@test did not return a boolean</xsl:message>
</xsl:if>
<xsl:variable name="impl:successful" as="xs:boolean" select="$impl:assert"/>
<xsl:if test="not($impl:successful)">
<xsl:message> FAILED</xsl:message>
</xsl:if>
<x:test successful="{ $impl:successful }">
<x:label>the result</x:label>
<xsl:call-template name="test:report-value">
<xsl:with-param name="value" select="$x:result"/>
<xsl:with-param name="wrapper-name" select="'x:result'"/>
<xsl:with-param name="wrapper-ns" select="'http://www.jenitennison.com/xslt/xspec'"/>
</xsl:call-template>
</x:test>
</xsl:template>
</xsl:stylesheet>