Skip to content

Commit

Permalink
Merge branch 'master' into test_ant-1-10-14
Browse files Browse the repository at this point in the history
  • Loading branch information
AirQuick committed Aug 24, 2023
2 parents aadaa93 + 3e50a36 commit d53f500
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion test/ci/env/global.env
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ XMLCALABASH_VERSION=

# Latest XMLResolver.org XML Resolver
# Required by XML Calabash, even when not required by Saxon.
XMLRESOLVERORG_XMLRESOLVER_VERSION=5.2.0
XMLRESOLVERORG_XMLRESOLVER_VERSION=5.2.1
Original file line number Diff line number Diff line change
@@ -1,130 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<x:description
xmlns:myv="http://example.org/ns/my/variable"
xmlns:x="http://www.jenitennison.com/xslt/xspec"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
stylesheet="../../src/compiler/compile-xslt-tests.xsl"
stylesheet="../src/compiler/base/util/compiler-pending-utils.xsl"
xslt-version="3.0">

<x:scenario label="Tests for 'stacked-explicit-pending' accumulator">
<x:helper stylesheet="../src/compiler/base/util/compiler-misc-utils.xsl" />

<x:scenario label="Tests for 'stacked-explicit-pending' accumulator" xml:base="end-to-end/cases/">
<x:scenario label="Pending scenarios that use @pending and nest">
<x:variable name="myv:context" href="../end-to-end/cases/focus-vs-pending-attribute.xspec"/>
<x:call function="true"/>
<!-- Applying templates via <x:context> is not actually needed for checking
accumulator values but makes the $x:context variable available. -->
<x:context href="focus-vs-pending-attribute.xspec"/>
<x:expect label="Prior to any pending markup, accumulator is an empty sequence"
test="$myv:context/x:description/accumulator-before('stacked-explicit-pending')"
test="exactly-one($x:context/x:description)/accumulator-before('stacked-explicit-pending')"
select="()"/>
<x:expect label="Prior to start of Pending #1 scenario, accumulator is still an empty sequence"
test="$myv:context//x:scenario[@pending='Pending #1']/preceding-sibling::*[1]/accumulator-before('stacked-explicit-pending')"
test="exactly-one($x:context//x:scenario[@pending='Pending #1']/preceding-sibling::*[1])/accumulator-before('stacked-explicit-pending')"
select="()"/>
<x:expect label="At start of Pending #1 scenario, accumulator has first pending reason"
test="$myv:context//x:scenario[@pending='Pending #1']/accumulator-before('stacked-explicit-pending')"
test="$x:context//x:scenario[@pending='Pending #1']/accumulator-before('stacked-explicit-pending')"
select="'Pending #1'"/>
<x:expect label="Prior to start of Pending #2 scenario, accumulator still has only first pending reason"
test="$myv:context//x:scenario[@pending='Pending #2']/preceding-sibling::*[1]/accumulator-before('stacked-explicit-pending')"
test="$x:context//x:scenario[@pending='Pending #2']/preceding-sibling::*[1]/accumulator-before('stacked-explicit-pending')"
select="'Pending #1'"/>
<x:expect label="At start of Pending #2 scenario, accumulator has second followed by first pending reason"
test="$myv:context//x:scenario[@pending='Pending #2']/accumulator-before('stacked-explicit-pending')"
test="$x:context//x:scenario[@pending='Pending #2']/accumulator-before('stacked-explicit-pending')"
select="('Pending #2','Pending #1')"/>
<x:expect label="Inside Pending #2 scenario, accumulator still has second followed by first pending reason"
test="$myv:context//x:scenario[@pending='Pending #2']/x:scenario[not(@pending)]/accumulator-before('stacked-explicit-pending')"
test="$x:context//x:scenario[@pending='Pending #2']/x:scenario[not(@pending)]/accumulator-before('stacked-explicit-pending')"
select="('Pending #2','Pending #1')"/>
<x:expect label="At end of Pending #2 scenario, accumulator has first pending reason"
test="$myv:context//x:scenario[@pending='Pending #2']/accumulator-after('stacked-explicit-pending')"
test="$x:context//x:scenario[@pending='Pending #2']/accumulator-after('stacked-explicit-pending')"
select="'Pending #1'"/>
<x:expect label="At end of Pending #1 scenario, accumulator is an empty sequence"
test="$myv:context//x:scenario[@pending='Pending #1']/accumulator-after('stacked-explicit-pending')"
test="exactly-one($x:context//x:scenario[@pending='Pending #1'])/accumulator-after('stacked-explicit-pending')"
select="()"/>
</x:scenario>
<x:scenario label="Pending scenario that uses x:pending[@label]">
<x:variable name="myv:context" href="../end-to-end/cases/pending.xspec"/>
<x:call function="true"/>
<x:context href="pending.xspec"/>
<x:expect label="At start of x:pending[@label], accumulator has pending reason"
test="$myv:context//x:pending[@label='testing x:pending']/accumulator-before('stacked-explicit-pending')"
test="$x:context//x:pending[@label='testing x:pending']/accumulator-before('stacked-explicit-pending')"
select="'testing x:pending'"/>
<!-- In the next two x:expect elements, the choice of [1] is not significant. The point is
merely to show that the accumulator holds its value until the next match of an accumulator rule. -->
<x:expect label="At start of scenario inside x:pending[@label], accumulator still has pending reason"
test="$myv:context//x:pending[@label='testing x:pending']/x:scenario[1]/accumulator-before('stacked-explicit-pending')"
test="$x:context//x:pending[@label='testing x:pending']/x:scenario[1]/accumulator-before('stacked-explicit-pending')"
select="'testing x:pending'"/>
<x:expect label="At end of scenario inside x:pending[@label], accumulator still has pending reason"
test="$myv:context//x:pending[@label='testing x:pending']/x:scenario[1]/accumulator-after('stacked-explicit-pending')"
test="$x:context//x:pending[@label='testing x:pending']/x:scenario[1]/accumulator-after('stacked-explicit-pending')"
select="'testing x:pending'"/>
<x:expect label="At end of x:pending[@label], accumulator no longer has pending reason"
test="$myv:context//x:pending[@label='testing x:pending']/accumulator-after('stacked-explicit-pending')"
test="exactly-one($x:context//x:pending[@label='testing x:pending'])/accumulator-after('stacked-explicit-pending')"
select="()"/>
</x:scenario>
<x:scenario label="Pending scenario that uses x:pending[x:label]">
<x:variable name="myv:context" href="../end-to-end/cases/pending.xspec"/>
<x:call function="true"/>
<x:context href="pending.xspec"/>
<x:expect label="At start of x:pending[x:label], accumulator has pending reason"
test="$myv:context//x:pending[x:label]/accumulator-before('stacked-explicit-pending')"
test="$x:context//x:pending[x:label]/accumulator-before('stacked-explicit-pending')"
select="''"/>
<x:expect label="At start of scenario inside x:pending[x:label], accumulator has pending reason"
test="$myv:context//x:pending[x:label]/x:scenario[1]/accumulator-before('stacked-explicit-pending')"
test="$x:context//x:pending[x:label]/x:scenario[1]/accumulator-before('stacked-explicit-pending')"
select="''"/>
<x:expect label="At end of scenario inside x:pending[x:label], accumulator still has pending reason"
test="$myv:context//x:pending[x:label]/x:scenario[1]/accumulator-after('stacked-explicit-pending')"
test="$x:context//x:pending[x:label]/x:scenario[1]/accumulator-after('stacked-explicit-pending')"
select="''"/>
<x:expect label="At end of x:pending[x:label], accumulator no longer has pending reason"
test="$myv:context//x:pending[x:label]/accumulator-after('stacked-explicit-pending')"
test="exactly-one($x:context//x:pending[x:label])/accumulator-after('stacked-explicit-pending')"
select="()"/>
</x:scenario>
</x:scenario>

<x:scenario label="Tests for x:reason-for-pending function">
<x:scenario label="Tests for x:reason-for-pending function" xml:base="compiler-pending-utils/reason-for-pending/">
<x:call function="x:reason-for-pending"/>
<x:scenario label="No focus or pending">
<x:call>
<x:param select="//x:scenario[@label='inner']" href="compiler-pending-utils-context-simple.xml"/>
<x:param select="//x:scenario[@label='inner']" href="simple.xspec"/>
</x:call>
<x:expect label="Empty sequence" select="()"/>
</x:scenario>
<x:scenario label="@focus on ancestor scenario">
<x:call>
<x:param select="//x:scenario[@label='inner']" href="compiler-pending-utils-context-focus-ancestor.xml"/>
<x:param select="//x:scenario[@label='inner']" href="focus-ancestor.xspec"/>
</x:call>
<x:expect label="Empty sequence, because ancestor's @focus overrides pending reason" select="()"/>
</x:scenario>
<x:scenario label="Parameter located in pending scenario and inherited by scenario with @focus">
<x:call>
<x:param select="//x:param[@name='param']" href="compiler-pending-utils-context-inherited-var.xml"/>
<x:param select="//x:param[@name='param']" href="inherited-var.xspec"/>
</x:call>
<x:expect label="Empty sequence, because inheritance overrides pending reason" select="()"/>
</x:scenario>
<x:scenario label="Variable located in pending scenario and inherited by scenario with @focus">
<x:call>
<x:param select="//x:variable[@name='var']" href="compiler-pending-utils-context-inherited-var.xml"/>
<x:param select="//x:variable[@name='var']" href="inherited-var.xspec"/>
</x:call>
<x:expect label="Empty sequence, because inheritance overrides pending reason" select="()"/>
</x:scenario>
<x:scenario label="@focus elsewhere makes a scenario pending (implicit reason)">
<x:call>
<x:param select="//x:scenario[@label='not-explicitly-pending']" href="compiler-pending-utils-context-focus-pending.xml"/>
<x:param select="//x:scenario[@label='not-explicitly-pending']" href="focus-pending.xspec"/>
</x:call>
<x:expect label="Reason from first @focus" select="'focus-reason1'"/>
</x:scenario>
<x:scenario label="@focus irrelevant for element outside scenarios">
<x:call>
<x:param select="//x:param[@name='global-param']" href="compiler-pending-utils-context-focus-ancestor.xml"/>
<x:param select="//x:param[@name='global-param']" href="focus-ancestor.xspec"/>
</x:call>
<x:expect label="Empty sequence, because @focus does not make this context pending" select="()"/>
</x:scenario>
<x:scenario label="@focus and @pending both affect context, ">
<x:scenario label="where pending scenario is before focused scenario">
<x:call>
<x:param select="//x:scenario[@label='pending1']" href="compiler-pending-utils-context-focus-pending.xml"/>
<x:param select="//x:scenario[@label='pending1']" href="focus-pending.xspec"/>
</x:call>
<x:expect label="@pending reason is preferred" select="'pending-reason1'"/>
</x:scenario>
<x:scenario label="where pending scenario is after focused scenario">
<x:call>
<x:param select="//x:scenario[@label='pending2']" href="compiler-pending-utils-context-focus-pending.xml"/>
<x:param select="//x:scenario[@label='pending2']" href="focus-pending.xspec"/>
</x:call>
<x:expect label="@pending reason is preferred" select="'pending-reason2'"/>
</x:scenario>
<x:scenario label="where child of scenario[@pending] is deeper than focused scenario">
<x:call>
<x:param select="//x:scenario[@label='inner']" href="compiler-pending-utils-context-focus-pending.xml"/>
<x:param select="//x:scenario[@label='inner']" href="focus-pending.xspec"/>
</x:call>
<x:expect label="@pending reason is preferred" select="'pending-reason3'"/>
</x:scenario>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This file is not a complete XSpec test and is not designed to be
run as a test. -->
<x:description xmlns:x="http://www.jenitennison.com/xslt/xspec" stylesheet="">
<x:param name="global-param"></x:param>
<x:param name="global-param"/>
<x:scenario focus="focus-reason" label="outer">
<x:scenario label="inner" pending="pending-reason"/>
</x:scenario>
Expand Down

0 comments on commit d53f500

Please sign in to comment.