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

x:label affects attribute(test) evaluation on XQuery #438

Closed
AirQuick opened this issue Nov 17, 2018 · 0 comments · Fixed by #439
Closed

x:label affects attribute(test) evaluation on XQuery #438

AirQuick opened this issue Nov 17, 2018 · 0 comments · Fixed by #439
Assignees
Labels

Comments

@AirQuick
Copy link
Member

x:label affects not only the expectation (#308) but also @test on XQuery.

Put this .xspec file in [XSpec]/test/:

<?xml version="1.0" encoding="UTF-8"?>
<x:description query="x-urn:test:do-nothing" query-at="do-nothing.xquery"
	stylesheet="do-nothing.xsl" xmlns:do-nothing="x-urn:test:do-nothing"
	xmlns:x="http://www.jenitennison.com/xslt/xspec">

	<x:scenario label="When x:call returns a non-empty item">
		<x:call function="exactly-one">
			<x:param select="123" />
		</x:call>
		<x:expect test="exists($x:result)">
			<x:label>//x:expect[@test eq 'exists($x:result)'][empty(attribute() except
				@test)][x:label][empty(node() except (x:label | text()[not(normalize-space())]))]
				should be Success</x:label>
		</x:expect>
	</x:scenario>
</x:description>

Running XSpec -t with it passes:

passed: 1 / pending: 0 / failed: 0 / total: 1

Running -q fails:

passed: 0 / pending: 0 / failed: 1 / total: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant