This repository has been archived by the owner on Oct 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_translator.xprocspec
99 lines (92 loc) · 3.13 KB
/
test_translator.xprocspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?xml version="1.0" encoding="UTF-8"?>
<x:description xmlns:x="http://www.daisy.org/ns/xprocspec"
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:px="http://www.daisy.org/ns/pipeline/xproc"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:pxi="http://www.daisy.org/ns/pipeline/xproc/internal">
<x:script>
<p:declare-step type="pxi:transform" version="1.0">
<p:input port="source"/>
<p:output port="result"/>
<p:option name="grade" required="true"/>
<p:import href="http://www.daisy.org/pipeline/modules/braille/common-utils/library.xpl"/>
<p:add-attribute match="/*" attribute-name="style" attribute-value="hyphens:auto"/>
<p:add-attribute match="html:p" attribute-name="style" attribute-value="display:block"/>
<px:transform type="css-block">
<p:with-option name="query" select="concat('(translator:nlb)(grade:',$grade,')')"/>
</px:transform>
<p:delete match="@style"/>
</p:declare-step>
</x:script>
<x:scenario label="test_1">
<x:call step="pxi:transform">
<x:input port="source">
<x:document type="inline">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>foobar</p>
</div>
</x:document>
</x:input>
</x:call>
<x:scenario label="grade 0">
<x:call>
<x:option name="grade" select="'0'"/>
</x:call>
<x:context label="result">
<x:document type="port" port="result"/>
</x:context>
<x:expect label="result" type="compare">
<x:document type="inline">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>⠋⠕⠕⠃⠁⠗</p>
</div>
</x:document>
</x:expect>
</x:scenario>
<x:scenario label="grade 1">
<x:call>
<x:option name="grade" select="'1'"/>
</x:call>
<x:context label="result">
<x:document type="port" port="result"/>
</x:context>
<x:expect label="result" type="compare">
<x:document type="inline">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>⠋⠕⠕⠃⠼</p>
</div>
</x:document>
</x:expect>
</x:scenario>
<x:scenario label="grade 2">
<x:call>
<x:option name="grade" select="'2'"/>
</x:call>
<x:context label="result">
<x:document type="port" port="result"/>
</x:context>
<x:expect label="result" type="compare">
<x:document type="inline">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>⠋⠕⠕⠃⠼</p>
</div>
</x:document>
</x:expect>
</x:scenario>
<x:scenario label="grade 3">
<x:call>
<x:option name="grade" select="'3'"/>
</x:call>
<x:context label="result">
<x:document type="port" port="result"/>
</x:context>
<x:expect label="result" type="compare">
<x:document type="inline">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>⠋⠕⠕⠃⠼</p>
</div>
</x:document>
</x:expect>
</x:scenario>
</x:scenario>
</x:description>