Debian Codegraph @

tests/yaml/emphasis.yaml

raw symbols SCIP
1 display: tables/unicode-without-blank.dis
2
3 # Test letter, word and phrase emphasis
4
5 table: |
6 include tables/spaces.uti
7 include tables/en-chardefs.cti
8 emphclass italic
9 emphletter italic 46-25
10 begemphword italic 456-46
11 endemphword italic 3-6
12 begemphphrase italic 456-46-46
13 endemphphrase italic before 456-46
14 lenemphphrase italic 3
15
16 tests:
17 - # no emphasis, just warming up
18 - abcdefg
19 - ⠁⠃⠉⠙⠑⠋⠛
20 - # single letter emphasis
21 - abcdefg
22 - ⠁⠃⠉⠨⠒⠙⠑⠋⠛
23 - typeform:
24 italic: ' + '
25 - # single letter emphasis
26 - abc defg
27 - ⠁⠃⠉ ⠨⠒⠙⠑⠋⠛
28 - typeform:
29 italic: ' + '
30 - # plain old word emphasis
31 - abcdefg
32 - ⠸⠨⠁⠃⠉⠙⠑⠋⠛
33 - typeform:
34 italic: '+++++++'
35 - # again word emphasis
36 - abc defg
37 - ⠸⠨⠁⠃⠉ ⠙⠑⠋⠛
38 - typeform:
39 italic: '+++ '
40 - # again word emphasis
41 - abc defg
42 - ⠸⠨⠁⠃⠉ ⠸⠨⠙⠑⠋⠛
43 - typeform:
44 italic: '++++++++'
45 - # emphasis within word
46 - abcdefg
47 - ⠁⠃⠸⠨⠉⠙⠄⠠⠑⠋⠛
48 - typeform:
49 italic: ' ++ '
50 - # phrase emphasis
51 - abc abc abc defg defg
52 - ⠸⠨⠨⠁⠃⠉ ⠁⠃⠉ ⠁⠃⠉ ⠸⠨⠙⠑⠋⠛ ⠙⠑⠋⠛
53 - typeform:
54 italic: '++++++++++++++++ '
55
56 # Test begemph and endemph
57
58 table: |
59 include tables/spaces.uti
60 include tables/en-chardefs.cti
61 emphclass italic
62 begemph italic 46-3
63 endemph italic 46-36
64
65 tests:
66 - # no emphasis, just warming up
67 - abcdefg
68 - ⠁⠃⠉⠙⠑⠋⠛
69 - # plain old emphasis
70 - abcdefg
71 - ⠨⠄⠁⠃⠉⠙⠑⠋⠛⠨⠤
72 - typeform:
73 italic: '+++++++'
74 - # emphasis just one word
75 - abc defg
76 - ⠨⠄⠁⠃⠉⠨⠤ ⠙⠑⠋⠛
77 - typeform:
78 italic: '+++ '
79 - # emphasis across multiple words
80 - abc defg
81 - ⠨⠄⠁⠃⠉ ⠙⠑⠋⠛⠨⠤
82 - typeform:
83 italic: '++++++++'
84 - # emphasis within word
85 - abcdefg
86 - ⠁⠃⠨⠄⠉⠙⠨⠤⠑⠋⠛
87 - typeform:
88 italic: ' ++ '
89 - # emphasis across multiple words
90 - abc abc abc defg defg
91 - ⠨⠄⠁⠃⠉ ⠁⠃⠉ ⠁⠃⠉ ⠙⠑⠋⠛⠨⠤ ⠙⠑⠋⠛
92 - typeform:
93 italic: '++++++++++++++++ '
94 - # emphasis ends on a space: the endemph indicator comes after the space
95 # (https://github.com/liblouis/liblouis/issues/1002)
96 - abc abc abc defg defg
97 - ⠨⠄⠁⠃⠉ ⠁⠃⠉ ⠁⠃⠉ ⠙⠑⠋⠛⠨⠤ ⠙⠑⠋⠛
98 - typeform:
99 italic: '+++++++++++++++++ '
100
101 # Test emphletter in combination with begemphword and endemphword:
102 # emphletter is only used for single letters
103
104 table: |
105 include tables/spaces.uti
106 include tables/latinLetterDef6Dots.uti
107 begcapsword 6-6
108 endcapsword 3
109 capsletter 6
110 tests:
111 - - Abc ABc aBC ABC
112 - ⠠⠁⠃⠉ ⠠⠠⠁⠃⠄⠉ ⠁⠠⠠⠃⠉ ⠠⠠⠁⠃⠉
113
114 # Test emphletter in combination with begemphword (but without
115 # endemphword): emphletter is also used when emphasis ends within a
116 # word
117
118 table: |
119 include tables/spaces.uti
120 include tables/latinLetterDef6Dots.uti
121 begcapsword 6-6
122 capsletter 6
123 punctuation . 46
124 punctuation - 36
125 capsmodechars -
126 tests:
127 - - Abc ABc aBC ABC ABC.def ABC-def
128 - ⠠⠁⠃⠉ ⠠⠁⠠⠃⠉ ⠁⠠⠠⠃⠉ ⠠⠠⠁⠃⠉ ⠠⠠⠁⠃⠉⠨⠙⠑⠋ ⠠⠁⠠⠃⠠⠉⠤⠙⠑⠋
129
130 # Test emphletter in combination with begemph and endemph: emphletter
131 # is only used for single letters
132
133 table: |
134 include tables/spaces.uti
135 include tables/latinLetterDef6Dots.uti
136 begcaps 6-6
137 endcaps 3
138 capsletter 6
139 tests:
140 - - Abc ABc aBC x ABC
141 - ⠠⠁⠃⠉ ⠠⠠⠁⠃⠄⠉ ⠁⠠⠠⠃⠉⠄ ⠭ ⠠⠠⠁⠃⠉⠄
142
143 # Test emphletter when begemph and begemphword are both not defined
144
145 table: |
146 include tables/spaces.uti
147 include tables/latinLetterDef6Dots.uti
148 capsletter 6
149 tests:
150 - - Abc ABc aBC ABC
151 - ⠠⠁⠃⠉ ⠠⠁⠠⠃⠉ ⠁⠠⠃⠠⠉ ⠠⠁⠠⠃⠠⠉
152
153 # Test begemphword and endemphword when emphletter is not defined:
154 # begcapsword and endemphword are also used for single letters
155
156 table: |
157 include tables/spaces.uti
158 include tables/latinLetterDef6Dots.uti
159 begcapsword 6
160 endcapsword 3
161 tests:
162 - - A Abc ABc aBC ABC
163 - ⠠⠁ ⠠⠁⠄⠃⠉ ⠠⠁⠃⠄⠉ ⠁⠠⠃⠉ ⠠⠁⠃⠉
164
165 # Test that an emphasized section indicated with begemph/endemph does not start or end with a space
166
167 display: |
168 display \s 0
169 include tables/latinLetterDef6Dots.uti
170 display / a
171 display _ b
172 table: |
173 space \s 0
174 include tables/latinLetterDef6Dots.uti
175 emphclass italic
176 begemph italic a
177 endemph italic a
178 tests:
179 - - " foo bar"
180 - " /foo/ bar"
181 - typeform:
182 italic: '+++++ '
183
184 # This behavior can be changed with the noemphchars opcode
185 table: |
186 space \s 0
187 include tables/latinLetterDef6Dots.uti
188 emphclass italic
189 begemph italic a
190 endemph italic a
191 sign \xE000 e
192 noemphchars italic \xE000 # just some random character because list can not be empty; what matters is that \s is not included
193 tests:
194 - - " foo bar"
195 - "/ foo /bar"
196 - typeform:
197 italic: '+++++ '
198
199 # Test order of opening and closing indicators
200
201 display: |
202 display \s 0
203 include tables/latinLetterDef6Dots.uti
204 display / a
205 display _ b
206 table: |
207 space \s 0
208 include tables/latinLetterDef6Dots.uti
209 emphclass italic
210 begemph italic a
211 endemph italic a
212 emphclass underline
213 begemph underline b
214 endemph underline b
215 tests:
216 # 1. if closing multiple emphasis, order of closing indicators is inverse of order of opening indicators
217 - - "foobar"
218 - "_/foo/bar_"
219 - typeform:
220 italic: '+++ '
221 underline: '++++++'
222 - - "foobar"
223 - "/_foo_bar/"
224 - typeform:
225 italic: '++++++'
226 underline: '+++ '
227 # 2. if opening multiple emphasis, order of opening indicators is inverse of order of closing indicators
228 - - "foobar"
229 - "_foo/bar/_"
230 - typeform:
231 italic: ' +++'
232 underline: '++++++'
233 - - "foobar"
234 - "/foo_bar_/"
235 - typeform:
236 italic: '++++++'
237 underline: ' +++'
238 # 3. if above rules are not conclusive, order of indicators is determined by order of emphclass definitions
239 - - "foobar"
240 - "_/foobar/_"
241 - typeform:
242 italic: '++++++'
243 underline: '++++++'
244 - - " foobar"
245 - " _/foobar/_"
246 - typeform:
247 italic: '+++++++'
248 underline: ' ++++++'