1 <?xml version=
"1.0" encoding=
"UTF-8"?>
3 <!-- Copyright (C) 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html -->
4 <!-- Copyright (c) 2007-2009 IBM Corporation and others. All rights reserved -->
6 <!-- Test data file for string search -->
7 <!DOCTYPE stringsearch-tests [
8 <!ELEMENT stringsearch-tests (test-case+)
>
9 <!ATTLIST stringsearch-tests debug IDREF #IMPLIED
>
10 <!ELEMENT test-case (pattern, pre?, m?, post?)
>
14 strength (PRIMARY | SECONDARY | TERTIARY | QUATERNARY | IDENTICAL)
"TERTIARY"
16 alternate_handling (NON_IGNORABLE | SHIFTED)
"NON_IGNORABLE"
19 <!ELEMENT pattern (#PCDATA)
>
20 <!ELEMENT pre (#PCDATA)
>
21 <!ELEMENT m (#PCDATA)
>
22 <!ELEMENT post (#PCDATA)
>
26 <!-- debug="test11" (for copying into the above element) -->
28 <!-- Very simple match -->
29 <test-case id=
"test01" >
30 <pattern>abc
</pattern>
31 <pre>xxx
</pre><m>abc
</m><post>yyy
</post>
34 <!-- Very simple no-match -->
35 <test-case id=
"test02" >
36 <pattern>abc
</pattern>
37 <pre>xxx
</pre><post>yyy
</post>
40 <!-- Match after several near-misses. -->
41 <test-case id=
"test03" >
42 <pattern>string
</pattern>
43 <pre>silly spring stling strxng strilg strinx stri
</pre><m>string
</m><post> fling
</post>
46 <test-case id=
"test04" strength=
"PRIMARY" >
47 <pattern>FUSS
</pattern>
48 <pre>abc
</pre><m>fuss
</m><post>sss
</post>
51 <test-case id=
"test05" strength=
"PRIMARY" >
52 <pattern>FUSS
</pattern>
53 <pre>abc
</pre><m>fuß
</m><post>sss
</post>
56 <test-case id=
"test05.5" strength=
"PRIMARY" >
57 <pattern>fuss
</pattern>
60 <post>ball table
</post>
63 <test-case id=
"test06" strength=
"PRIMARY" >
64 <pattern>fuß
</pattern>
65 <pre>abc
</pre><m>fuss
</m><post>xyz
</post>
68 <test-case id=
"test07" strength=
"SECONDARY" >
69 <pattern>fuß
</pattern>
73 <test-case id=
"test08" strength=
"PRIMARY" >
74 <pattern>fus
</pattern>
75 <pre>abcfuß
</pre><post>xyz
</post>
78 <!-- A good match following an initial match that failed because
79 of not ending on a character boundary -->
80 <test-case id=
"test09" strength=
"PRIMARY">
81 <pattern>fus
</pattern>
82 <pre>fuß
</pre><m>fus
</m><post>sss
</post>
86 <!-- Test cases from usrchdat.c BREAKITERATOREXACT -->
88 <test-case id=
"test10" strength=
"TERTIARY">
89 <pattern>fox
</pattern>
90 <m>fox
</m><post>y fox
</post>
93 <test-case id=
"test11" strength=
"PRIMARY" locale=
"de_DE@collation=phonebook">
94 <pattern>toe
</pattern>
95 <pre>This is a
</pre><m>Tö
</m><post>ne
</post>
98 <test-case id=
"test11a" strength=
"SECONDARY" locale=
"de_DE@collation=phonebook">
99 <pattern>toe
</pattern>
100 <pre>This is a
</pre><post>Töne
</post>
103 <test-case id=
"test12" strength=
"TERTIARY">
105 <pre>tésting that é doés not match
</pre><m>e
</m><post></post>
108 <test-case id=
"test13" strength=
"PRIMARY" locale=
"fr">
110 <pre></pre><m>É
</m><post>É
</post>
113 <test-case id=
"test14" strength=
"PRIMARY" locale=
"fr">
115 <pre>C
</pre><m>O\u0302
</m><post>TÉ
</post>
119 <!-- Test cases from usrchdat.c STRENGTH -->
122 <test-case id=
"test15" strength=
"PRIMARY" locale=
"en">
123 <pattern>fox
</pattern>
124 <pre>The quick brown
</pre><m>fox
</m><post> jumps over the lazy foxes
</post>
127 <test-case id=
"test16" strength=
"PRIMARY" locale=
"fr">
128 <pattern>peche
</pattern>
129 <pre>blackbirds pat
</pre><m>p\u00E9ch\u00E9
</m><post> </post>
132 <test-case id=
"test17" strength=
"PRIMARY" locale=
"fr">
133 <pattern>peche
</pattern>
134 <pre>blackbirds pat
</pre><m>p\u00EAche
</m><post> </post>
137 <test-case id=
"test18" strength=
"PRIMARY" locale=
"fr">
138 <pattern>peche
</pattern>
139 <pre>blackbirds pat
</pre><m>p\u00E9che
</m><post>r
</post>
142 <test-case id=
"test19" strength=
"PRIMARY" locale=
"fr">
143 <pattern>peche
</pattern>
144 <pre>blackbirds pat
</pre><m>p\u00EAche
</m><post>r
</post>
147 <test-case id=
"test20" strength=
"PRIMARY" locale=
"es">
148 <pattern>channel
</pattern>
149 <pre>A
</pre><m>channel
</m><post>,
</post>
152 <test-case id=
"test21" strength=
"PRIMARY" locale=
"es">
153 <pattern>channel
</pattern>
154 <pre>A
</pre><m>CHANNEL
</m><post>,
</post>
157 <test-case id=
"test22" strength=
"PRIMARY" locale=
"es">
158 <pattern>channel
</pattern>
159 <pre>A
</pre><m>Channel
</m><post>s,
</post>
162 <test-case id=
"test23" strength=
"PRIMARY" locale=
"es">
163 <pattern>channel
</pattern>
164 <pre>A
</pre><m>channel
</m><post>...
</post>
167 <test-case id=
"test24" strength=
"TERTIARY" locale=
"en">
168 <pattern>A\u0300
</pattern>
169 <pre>A miss, and then
</pre><m>\u00c0
</m><post> should match but not A"
</post>
172 <!-- TODO: In the original test data, this test matched at IDENTICAL strength.
173 Doesn't seem right. The characters are different.
175 <test-case id=
"test24a" strength=
"IDENTICAL" locale=
"en">
176 <pattern>A\u0300
</pattern>
177 <pre>At IDENTICAL, shoud this match?
</pre><m>\u00c0
</m><post></post>
180 <test-case id=
"test24b" strength=
"IDENTICAL" alternate_handling=
"SHIFTED" locale=
"en">
181 <pattern>A\u0300
</pattern>
182 <pre>At IDENTICAL, shoud this match?
</pre>
187 <test-case id=
"test25" strength=
"SECONDARY" locale=
"en">
189 <pre>12</pre><m>ű
</m><post> Ű
</post>
192 <test-case id=
"test26" strength=
"SECONDARY" locale=
"en">
194 <pre>12</pre><m>a
</m><post>...
</post>
198 <!-- Test Cases from usrchdat.c, VARIABLE -->
199 <test-case id=
"test27" strength=
"TERTIARY" locale=
"en">
200 <pattern>blackbird
</pattern>
201 <pre>black-bird
</pre><m>blackbird
</m><post>...
</post>
204 <test-case id=
"test28" strength=
"TERTIARY" locale=
"en">
205 <pattern>go
</pattern>
209 <!-- TODO: this gives an U_ILLEGAL_ARGUMENT error when opening
210 the UStringSearch. How did the orignal test run? -->
212 <test-case id="test29" strength="PRIMARY" locale="en">
214 <pre></pre><m></m><post>abc</post>
218 <test-case id=
"test30" strength=
"SECONDARY" locale=
"en">
219 <pattern>abc
</pattern>
220 <pre> a bc ab c a bc ab c"
</pre>
223 <test-case id=
"test31" strength=
"SECONDARY" locale=
"en">
224 <pattern>abc
</pattern>
225 <pre> ---------------
</pre>
229 <!-- Normalization test cases from usrchdat.c -->
230 <test-case id=
"test32" strength=
"TERTIARY" norm=
"ON">
231 <pattern>a\u0325\u0300
</pattern>
232 <pre></pre><m>a\u0300\u0325
</m>
236 <test-case id=
"test32a" strength=
"TERTIARY" norm=
"OFF">
237 <pattern>a\u0325\u0300
</pattern>
238 <pre>a\u0300\u0325
</pre>
242 <!-- COMPOSITEBOUNDARIES from usrchdat.c
243 Boundaries are not identical to orignal test data because
244 of matching only full combining sequences
246 <test-case id=
"test40" strength=
"TERTIARY">
248 <pre>À
</pre> <!-- \u00C0 -->
251 <test-case id=
"test41" strength=
"TERTIARY">
253 <pre>À
</pre><m>A
</m><post>C
</post>
256 <test-case id=
"test42" strength=
"TERTIARY">
257 <pattern>A\u030A
</pattern>
263 <!-- SUPPLEMENTARYCANONICAL from usrchdat.c -->
264 <test-case id=
"test50" strength=
"TERTIARY">
265 <pattern>\uD800\uDC00
</pattern>
266 <pre>abc \uD802\uDC00 \uD800\uDC01 \uD801\uDC00
</pre><m>\uD800\uDC00
</m>
267 <post>abc abc\uD800\uDC00 \uD800\uD800\uDC00 \uD800\uDC00\uDC00
</post>
270 <test-case id=
"test51" strength=
"TERTIARY">
271 <pattern>\\uD834\\uDDB9
</pattern>
272 <pre>and
</pre><m>\\uD834\\uDDB9
</m><post>this sentence
</post>
275 <test-case id=
"test52" strength=
"TERTIARY">
276 <pattern> \\uD834\\uDDB9
</pattern>
277 <pre>and
</pre><m> \\uD834\\uDDB9
</m><post>this sentence
</post>
280 <test-case id=
"test53" strength=
"TERTIARY">
281 <pattern>-\\uD834\\uDDB9-
</pattern>
282 <pre>and
</pre><m>-\\uD834\\uDDB9-
</m><post>this sentence
</post>
285 <test-case id=
"test54" strength=
"TERTIARY">
286 <pattern>,\\uD834\\uDDB9,
</pattern>
287 <pre>and
</pre><m>,\\uD834\\uDDB9,
</m><post>this sentence
</post>
290 <test-case id=
"test55" strength=
"TERTIARY">
291 <pattern>?\\uD834\\uDDB9?
</pattern>
292 <pre>and
</pre><m>?\\uD834\\uDDB9?
</m><post>this sentence
</post>
296 <!-- Long combining sequences -->
297 <!-- Backwards search fails because patterns ends w/ ignorables
298 <test-case id="test60" strength="PRIMARY">
299 <pattern>A\u0301\u0301\u0301\u0301</pattern>
300 <m>A\u0301\u0301\u0301\u0301\u0301</m>
304 <test-case id=
"test61" strength=
"TERTIARY">
305 <pattern>A\u0301\u0301\u0301\u0301
</pattern>
306 <pre>A\u0301\u0301\u0301\u0301\u0301
</pre>
309 <test-case id=
"test62" strength=
"TERTIARY">
310 <pattern>A\u0301\u0301\u0301\u0301
</pattern>
311 <m>A\u0301\u0301\u0301\u0301
</m>
314 <!-- stand-alone combining marks don't match attached marks -->
315 <test-case id=
"test63" strength=
"TERTIARY">
316 <pattern>\u0301
</pattern>
317 <pre>A\u0301\u0301\u0301\u0301
</pre>
320 <test-case id=
"test64" strength=
"TERTIARY">
321 <pattern>\u0301
</pattern>
322 <post>\u0301\u0301\u0301\u0301
</post>
325 <!-- stand-alone combining mark does match an un-attached combining mark -->
326 <test-case id=
"test65" strength=
"TERTIARY">
327 <pattern>\u0301
</pattern>
328 <m>\u0301
</m><post>A\u0301\u0301
</post>
331 <test-case id=
"test66" strength=
"TERTIARY">
332 <pattern>\u0301
</pattern>
336 <!-- stand-alone combining marks at end of the target text -->
337 <test-case id=
"test67" strength=
"TERTIARY">
338 <pattern>\u0301
</pattern>
339 <pre>abcd\r
</pre><m>\u0301
</m>
342 <!-- attached combining marks at end of the target text, no match -->
343 <test-case id=
"test68" strength=
"TERTIARY">
344 <pattern>\u0301
</pattern>
345 <pre>abcd\u0301
</pre>
350 <!-- no match within expansions at the start -->
351 <test-case id=
"test70" strength=
"PRIMARY">
352 <pattern>Eligature
</pattern>
356 <test-case id=
"test71" strength=
"PRIMARY">
357 <pattern>AEligature
</pattern>
361 <test-case id=
"test72" strength=
"PRIMARY">
362 <pattern>AEligature
</pattern>
366 <!-- unattached combining Tilde will not match a Tilde that is
367 part of a composed Ñ (\u00D1) -->
368 <test-case id=
"test73" strength=
"SECONDARY">
369 <pattern>\u0303
</pattern> <!-- combining tilde -->
370 <pre>Ñ

</pre><m>\u0303
</m>
373 <test-case id=
"test74" strength=
"SECONDARY">
374 <pattern>\u0303
</pattern> <!-- combining tilde -->
375 <pre>Ñ

</pre><m>\u0303
</m><post>a
</post>
378 <test-case id=
"test75" strength=
"TERTIARY" locale=
"fr">
379 <pattern>\u00EA
</pattern>
380 <pre>p
</pre><m>\u00EA
</m><post>che
</post>
383 <test-case id=
"test76" strength=
"TERTIARY" locale=
"fr">
384 <pattern>\u00EA
</pattern>
385 <pre>p
</pre><m>e\u0302
</m><post>che
</post>
388 <test-case id=
"test77" strength=
"TERTIARY" locale=
"fr">
389 <pattern>e\u0302
</pattern>
390 <pre>p
</pre><m>\u00EA
</m><post>che
</post>
393 <!-- Test cases from ticket:5382 -->
394 <test-case id=
"test78" strength=
"SECONDARY" locale=
"hu_HU">
395 <pattern>\u0170
</pattern>
400 <test-case id=
"test79" strength=
"SECONDARY" locale=
"hu_HU">
401 <pattern>\u0170
</pattern>
407 <test-case id=
"test80" strength=
"SECONDARY" locale=
"hu_HU">
408 <pattern>\u0170
</pattern>
413 <!-- Test cases from ticket:5959 -->
414 <test-case id=
"test81" strength=
"SECONDARY">
415 <pattern>\u2166
</pattern>
419 <test-case id=
"test82" strength=
"SECONDARY">
420 <pattern>VII
</pattern>
424 <test-case id=
"test83" strength=
"IDENTICAL" alternate_handling=
"SHIFTED" locale=
"en">
425 <pattern>Universal Declaration of Human Rights
</pattern>
426 <pre>Proclaims this
</pre><m>Universal Declaration of Human Rights
</m><post> as a common standard of achievement for all peoples and all nations
</post>
429 <test-case id=
"test83b" strength=
"TERTIARY" alternate_handling=
"SHIFTED" locale=
"en">
430 <pattern>Universal Declaration of Human Rights
</pattern>
431 <pre>Proclaims this
</pre>
432 <m>Universal-Declaration-of-Human-Rights
</m>
433 <post> as a common standard of achievement for all peoples and all nations
</post>
436 <test-case id=
"test84" strength=
"TERTIARY" locale=
"en">
437 <pattern>\u05E9\u0591\u05E9
</pattern>
438 <m>\u05E9\u0592\u05E9
</m>
441 <test-case id=
"test84b" strength=
"IDENTICAL" locale=
"en">
442 <pattern>\u05E9\u0591\u05E9
</pattern>
443 <pre>\u05E9\u0592\u05E9
</pre>
445 </stringsearch-tests>