You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?xml version="1.0" encoding="UTF-8"?>
<x:descriptionstylesheet="do-nothing.xsl"xmlns:x="http://www.jenitennison.com/xslt/xspec">
<x:scenario>
<x:label>Suppose you're testing count() function with child::element() selected but you
forget to provide the selection context (either inner XML or @href)</x:label>
<x:callfunction="count">
<x:paramselect="child::element()" />
</x:call>
<x:expectlabel="and you happen to expect 1"select="1" />
</x:scenario>
</x:description>
This x:param doesn't make sense, but x:expect returns Success without any complaint, because x:param/@select is evaluated in the source document node of the .xspec file.
So the source document can be harmful.
The purpose of the source document is discussed in expath#73. No use case is presented there.
On the other hand, I have one use case:
Command line and Ant provide a source document when running the tests. But it can be harmful. For example,
do-nothing.xsl
test.xspec
This
x:param
doesn't make sense, butx:expect
returns Success without any complaint, becausex:param/@select
is evaluated in the source document node of the .xspec file.So the source document can be harmful.
The purpose of the source document is discussed in expath#73. No use case is presented there.
On the other hand, I have one use case:
This way you can read the binary files relative to the .xspec file. I sometimes use this trick in my production XSpec files.
To sum up, I think
The text was updated successfully, but these errors were encountered: