Skip to content

Commit 00e516d

Browse files
committed
tests asserting that changes for #54 do not break ALEA's diwan transformation
1 parent b6decca commit 00e516d

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

xsl/projects/alea/html/diwan.xspec

+80
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,85 @@
6666
/>
6767
</x:scenario>
6868

69+
<x:scenario label="handling of choice: Order does NOT matter!">
70+
<x:context>
71+
<t:TEI xml:lang="de">
72+
<t:text>
73+
<t:body>
74+
<t:lg>
75+
<t:l>
76+
<t:choice>
77+
<t:corr>corrected</t:corr>
78+
<t:sic>seen in manuscript</t:sic>
79+
</t:choice>
80+
<t:caesura/>
81+
</t:l>
82+
<t:l>
83+
<t:choice>
84+
<t:sic>seen in manuscript</t:sic>
85+
<t:corr>emendation</t:corr>
86+
</t:choice>
87+
<t:caesura/>
88+
</t:l>
89+
</t:lg>
90+
</t:body>
91+
</t:text>
92+
</t:TEI>
93+
</x:context>
94+
<x:expect label="main text has text of corr at first position: 'corrected'"
95+
test="(//section[@class = 'content']//text()) => string-join() => matches('corrected')"/>
96+
<x:expect label="main text has text of corr at second position: 'emendation'"
97+
test="(//section[@class = 'content']//text()) => string-join() => matches('emendation')"/>
98+
<x:expect label="main text does not have text from sic, no matter of order"
99+
test="(//section[@class = 'content']//text()) => string-join() => matches('seen') => not()"/>
100+
<x:expect label="apparatus of first choice: lemma is 'corrected'"
101+
test="//span[@class = 'apparatus-line-entries'][1]//span[@class = 'apparatus-lemma'] ! string()"
102+
select="'corrected'"/>
103+
<x:expect label="apparatus of first choice: reading is 'seen in manuscript'"
104+
test="//span[@class = 'apparatus-line-entries'][1]//span[@class = 'reading']/span[@class = 'reading'] ! string()"
105+
select="'seen in manuscript'"/>
106+
<x:expect label="apparatus of second choice: lemma is 'emendation'"
107+
test="//span[@class = 'apparatus-line-entries'][2]//span[@class = 'apparatus-lemma'] ! string()"
108+
select="'emendation'"/>
109+
<x:expect label="apparatus of second choice: reading is 'seen in manuscript'"
110+
test="//span[@class = 'apparatus-line-entries'][2]//span[@class = 'reading']/span[@class = 'reading'] ! string()"
111+
select="'seen in manuscript'"/>
112+
</x:scenario>
113+
114+
<x:scenario label="handling of corr and sic not wrapped in choice">
115+
<x:context>
116+
<t:TEI xml:lang="de">
117+
<t:text>
118+
<t:body>
119+
<t:lg>
120+
<t:l>
121+
<t:corr>corrected</t:corr>
122+
<t:caesura/>
123+
</t:l>
124+
<t:l>
125+
<t:sic>seen in manuscript</t:sic>
126+
<t:caesura/>
127+
</t:l>
128+
</t:lg>
129+
</t:body>
130+
</t:text>
131+
</t:TEI>
132+
</x:context>
133+
<x:expect label="main text has text of corr at first position: 'corrected'"
134+
test="(//section[@class = 'content']//text()) => string-join() => matches('corrected')"/>
135+
<x:expect label="main text has text of sic at second position: 'seen in manuscript'"
136+
test="(//section[@class = 'content']//text()) => string-join() => matches('seen in manuscript')"/>
137+
<x:expect label="apparatus of first choice: lemma is 'corrected'"
138+
test="//span[@class = 'apparatus-line-entries'][1]//span[@class = 'apparatus-lemma'] ! string()"
139+
select="'corrected'"/>
140+
<x:expect label="apparatus of first choice: no reading"
141+
test="not(exists(//span[@class = 'apparatus-line-entries'][1]//span[@class = 'reading']/span[@class = 'reading']))"/>
142+
<x:expect label="apparatus of second choice: lemma is 'seen in manuscript'"
143+
test="//span[@class = 'apparatus-line-entries'][2]//span[@class = 'apparatus-lemma'] ! string()"
144+
select="'seen in manuscript'"/>
145+
<x:expect label="apparatus of second choice: no reading"
146+
test="not(exists(//span[@class = 'apparatus-line-entries'][2]//span[@class = 'reading']/span[@class = 'reading']))"
147+
/>
148+
</x:scenario>
69149

70150
</x:description>

0 commit comments

Comments
 (0)