Skip to content

Commit d843c00

Browse files
committed
make tests more precise: assert count of pb elements in the output
This is related to #4
1 parent 01c0c17 commit d843c00

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

xsl/document.xspec

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,17 @@
7676
<x:param name="tree" select="'page-hateoas'"/>
7777
<x:context href="../test/john.xml"/>
7878
<x:expect label="contains pb of page 1" test="exists(/t:TEI/dts:wrapper//t:pb[@n eq 2])"/>
79+
<x:expect label="contains one pb element" test="count(//t:pb)" select="1"/>
80+
</x:scenario>
81+
82+
<x:scenario
83+
label="Regression against issue 4: $start and $end on john.xml from different levels; page-hateoas">
84+
<x:param name="start" select="'p.2'"/>
85+
<x:param name="end" select="'p.2.end'"/>
86+
<x:param name="tree" select="'page-hateoas'"/>
87+
<x:context href="../test/john.xml"/>
88+
<x:expect label="contains pb of page 1" test="exists(/t:TEI/dts:wrapper//t:pb[@n eq 2])"/>
89+
<x:expect label="contains one pb element" test="count(//t:pb)" select="1"/>
7990
</x:scenario>
8091

8192
<x:scenario label="Regression against issue 4: $start and $end on matt.xml; pages">
@@ -85,6 +96,7 @@
8596
<x:context href="../test/matt.xml"/>
8697
<x:expect label="contains pb of page 1" test="exists(/t:TEI/dts:wrapper//t:pb[@n eq 1])"/>
8798
<x:expect label="contains pb of page 2" test="exists(/t:TEI/dts:wrapper//t:pb[@n eq 2])"/>
99+
<x:expect label="contains 2 pb elements" test="count(//t:pb)" select="1"/>
88100
</x:scenario>
89101

90102

0 commit comments

Comments
 (0)