1 <?xml version=
"1.0" encoding=
"UTF-8"?>
3 <!-- Copyright (c) 2007-2008 IBM Corporation and others. All rights reserved -->
5 <!-- Test data file for string search -->
6 <!DOCTYPE stringsearch-tests [
7 <!ELEMENT stringsearch-tests (test-case+)
>
8 <!ATTLIST stringsearch-tests debug IDREF #IMPLIED
>
9 <!ELEMENT test-case (pattern, pre?, m?, post?)
>
13 strength (PRIMARY | SECONDARY | TERTIARY | QUATERNARY | IDENTICAL)
"TERTIARY"
17 <!ELEMENT pattern (#PCDATA)
>
18 <!ELEMENT pre (#PCDATA)
>
19 <!ELEMENT m (#PCDATA)
>
20 <!ELEMENT post (#PCDATA)
>
23 <stringsearch-tests debug=
"test32">
24 <!-- debug="test11" (for copying into the above element) -->
26 <!-- Very simple match -->
27 <test-case id=
"test01" >
28 <pattern>abc
</pattern>
29 <pre>xxx
</pre><m>abc
</m><post>yyy
</post>
32 <!-- Very simple no-match -->
33 <test-case id=
"test02" >
34 <pattern>abc
</pattern>
35 <pre>xxx
</pre><post>yyy
</post>
38 <!-- Match after several near-misses. -->
39 <test-case id=
"test03" >
40 <pattern>string
</pattern>
41 <pre>silly spring stling strxng strilg strinx stri
</pre><m>string
</m><post> fling
</post>
44 <test-case id=
"test04" strength=
"PRIMARY" >
45 <pattern>FUSS
</pattern>
46 <pre>abc
</pre><m>fuss
</m><post>sss
</post>
49 <test-case id=
"test05" strength=
"PRIMARY" >
50 <pattern>FUSS
</pattern>
51 <pre>abc
</pre><m>fuß
</m><post>sss
</post>
54 <test-case id=
"test05.5" strength=
"PRIMARY" >
55 <pattern>fuss
</pattern>
58 <post>ball table
</post>
61 <test-case id=
"test06" strength=
"PRIMARY" >
62 <pattern>fuß
</pattern>
63 <pre>abc
</pre><m>fuss
</m><post>xyz
</post>
66 <test-case id=
"test07" strength=
"SECONDARY" >
67 <pattern>fuß
</pattern>
71 <test-case id=
"test08" strength=
"PRIMARY" >
72 <pattern>fus
</pattern>
73 <pre>abcfuß
</pre><post>xyz
</post>
76 <!-- A good match following an initial match that failed because
77 of not ending on a character boundary -->
78 <test-case id=
"test09" strength=
"PRIMARY">
79 <pattern>fus
</pattern>
80 <pre>fuß
</pre><m>fus
</m><post>sss
</post>
84 <!-- Test cases from usrchdat.c BREAKITERATOREXACT -->
86 <test-case id=
"test10" strength=
"TERTIARY">
87 <pattern>fox
</pattern>
88 <m>fox
</m><post>y fox
</post>
91 <test-case id=
"test11" strength=
"PRIMARY" locale=
"de_DE@collation=phonebook">
92 <pattern>toe
</pattern>
93 <pre>This is a
</pre><m>Tö
</m><post>ne
</post>
96 <test-case id=
"test11a" strength=
"SECONDARY" locale=
"de_DE@collation=phonebook">
97 <pattern>toe
</pattern>
98 <pre>This is a
</pre><post>Töne
</post>
101 <test-case id=
"test12" strength=
"TERTIARY">
103 <pre>tésting that é doés not match
</pre><m>e
</m><post></post>
106 <test-case id=
"test13" strength=
"PRIMARY" locale=
"fr">
108 <pre></pre><m>É
</m><post>É
</post>
111 <test-case id=
"test14" strength=
"PRIMARY" locale=
"fr">
113 <pre>C
</pre><m>O\u0302
</m><post>TÉ
</post>
117 <!-- Test cases from usrchdat.c STRENGTH -->
120 <test-case id=
"test15" strength=
"PRIMARY" locale=
"en">
121 <pattern>fox
</pattern>
122 <pre>The quick brown
</pre><m>fox
</m><post> jumps over the lazy foxes
</post>
125 <test-case id=
"test16" strength=
"PRIMARY" locale=
"fr">
126 <pattern>peche
</pattern>
127 <pre>blackbirds pat
</pre><m>p\u00E9ch\u00E9
</m><post> </post>
130 <test-case id=
"test17" strength=
"PRIMARY" locale=
"fr">
131 <pattern>peche
</pattern>
132 <pre>blackbirds pat
</pre><m>p\u00EAche
</m><post> </post>
135 <test-case id=
"test18" strength=
"PRIMARY" locale=
"fr">
136 <pattern>peche
</pattern>
137 <pre>blackbirds pat
</pre><m>p\u00E9che
</m><post>r
</post>
140 <test-case id=
"test19" strength=
"PRIMARY" locale=
"fr">
141 <pattern>peche
</pattern>
142 <pre>blackbirds pat
</pre><m>p\u00EAche
</m><post>r
</post>
145 <test-case id=
"test20" strength=
"PRIMARY" locale=
"es">
146 <pattern>channel
</pattern>
147 <pre>A
</pre><m>channel
</m><post>,
</post>
150 <test-case id=
"test21" strength=
"PRIMARY" locale=
"es">
151 <pattern>channel
</pattern>
152 <pre>A
</pre><m>CHANNEL
</m><post>,
</post>
155 <test-case id=
"test22" strength=
"PRIMARY" locale=
"es">
156 <pattern>channel
</pattern>
157 <pre>A
</pre><m>Channel
</m><post>s,
</post>
160 <test-case id=
"test23" strength=
"PRIMARY" locale=
"es">
161 <pattern>channel
</pattern>
162 <pre>A
</pre><m>channel
</m><post>...
</post>
165 <test-case id=
"test24" strength=
"TERTIARY" locale=
"en">
166 <pattern>A\u0300
</pattern>
167 <pre>A miss, and then
</pre><m>\u00c0
</m><post> should match but not A"
</post>
170 <!-- TODO: In the original test data, this test matched at IDENTICAL strength.
171 Doesn't seem right. The characters are different.
173 <test-case id=
"test24a" strength=
"IDENTICAL" locale=
"en">
174 <pattern>A\u0300
</pattern>
175 <pre>At IDENTICAL, shoud this match?
</pre><m>\u00c0
</m><post></post>
178 <test-case id=
"test25" strength=
"SECONDARY" locale=
"en">
180 <pre>12</pre><m>ű
</m><post> Ű
</post>
183 <test-case id=
"test26" strength=
"SECONDARY" locale=
"en">
185 <pre>12</pre><m>a
</m><post>...
</post>
189 <!-- Test Cases from usrchdat.c, VARIABLE -->
190 <test-case id=
"test27" strength=
"TERTIARY" locale=
"en">
191 <pattern>blackbird
</pattern>
192 <pre>black-bird
</pre><m>blackbird
</m><post>...
</post>
195 <test-case id=
"test28" strength=
"TERTIARY" locale=
"en">
196 <pattern>go
</pattern>
200 <!-- TODO: this gives an U_ILLEGAL_ARGUMENT error when opening
201 the UStringSearch. How did the orignal test run? -->
203 <test-case id="test29" strength="PRIMARY" locale="en">
205 <pre></pre><m></m><post>abc</post>
209 <test-case id=
"test30" strength=
"SECONDARY" locale=
"en">
210 <pattern>abc
</pattern>
211 <pre> a bc ab c a bc ab c"
</pre>
214 <test-case id=
"test31" strength=
"SECONDARY" locale=
"en">
215 <pattern>abc
</pattern>
216 <pre> ---------------
</pre>
220 <!-- Normalization test cases from usrchdat.c -->
221 <test-case id=
"test32" strength=
"TERTIARY" norm=
"ON">
222 <pattern>a\u0325\u0300
</pattern>
223 <pre></pre><m>a\u0300\u0325
</m>
227 <test-case id=
"test32a" strength=
"TERTIARY" norm=
"OFF">
228 <pattern>a\u0325\u0300
</pattern>
229 <pre>a\u0300\u0325
</pre>
233 <!-- COMPOSITEBOUNDARIES from usrchdat.c
234 Boundaries are not identical to orignal test data because
235 of matching only full combining sequences
237 <test-case id=
"test40" strength=
"TERTIARY">
239 <pre>À
</pre> <!-- \u00C0 -->
242 <test-case id=
"test41" strength=
"TERTIARY">
244 <pre>À
</pre><m>A
</m><post>C
</post>
247 <test-case id=
"test42" strength=
"TERTIARY">
248 <pattern>A\u030A
</pattern>
254 <!-- SUPPLEMENTARYCANONICAL from usrchdat.c -->
255 <test-case id=
"test50" strength=
"TERTIARY">
256 <pattern>\uD800\uDC00
</pattern>
257 <pre>abc \uD802\uDC00 \uD800\uDC01 \uD801\uDC00
</pre><m>\uD800\uDC00
</m>
258 <post>abc abc\uD800\uDC00 \uD800\uD800\uDC00 \uD800\uDC00\uDC00
</post>
261 <test-case id=
"test51" strength=
"TERTIARY">
262 <pattern>\\uD834\\uDDB9
</pattern>
263 <pre>and
</pre><m>\\uD834\\uDDB9
</m><post>this sentence
</post>
266 <test-case id=
"test52" strength=
"TERTIARY">
267 <pattern> \\uD834\\uDDB9
</pattern>
268 <pre>and
</pre><m> \\uD834\\uDDB9
</m><post>this sentence
</post>
271 <test-case id=
"test53" strength=
"TERTIARY">
272 <pattern>-\\uD834\\uDDB9-
</pattern>
273 <pre>and
</pre><m>-\\uD834\\uDDB9-
</m><post>this sentence
</post>
276 <test-case id=
"test54" strength=
"TERTIARY">
277 <pattern>,\\uD834\\uDDB9,
</pattern>
278 <pre>and
</pre><m>,\\uD834\\uDDB9,
</m><post>this sentence
</post>
281 <test-case id=
"test55" strength=
"TERTIARY">
282 <pattern>?\\uD834\\uDDB9?
</pattern>
283 <pre>and
</pre><m>?\\uD834\\uDDB9?
</m><post>this sentence
</post>
287 <!-- Long combining sequences -->
288 <test-case id=
"test60" strength=
"PRIMARY">
289 <pattern>A\u0301\u0301\u0301\u0301
</pattern>
290 <m>A\u0301\u0301\u0301\u0301\u0301
</m>
293 <test-case id=
"test61" strength=
"TERTIARY">
294 <pattern>A\u0301\u0301\u0301\u0301
</pattern>
295 <pre>A\u0301\u0301\u0301\u0301\u0301
</pre>
298 <test-case id=
"test62" strength=
"TERTIARY">
299 <pattern>A\u0301\u0301\u0301\u0301
</pattern>
300 <m>A\u0301\u0301\u0301\u0301
</m>
303 <!-- stand-alone combining marks don't match attached marks -->
304 <test-case id=
"test63" strength=
"TERTIARY">
305 <pattern>\u0301
</pattern>
306 <pre>A\u0301\u0301\u0301\u0301
</pre>
309 <test-case id=
"test64" strength=
"TERTIARY">
310 <pattern>\u0301
</pattern>
311 <post>\u0301\u0301\u0301\u0301
</post>
314 <!-- stand-alone combining mark does match an un-attached combining mark -->
315 <test-case id=
"test65" strength=
"TERTIARY">
316 <pattern>\u0301
</pattern>
317 <m>\u0301
</m><post>A\u0301\u0301
</post>
320 <test-case id=
"test66" strength=
"TERTIARY">
321 <pattern>\u0301
</pattern>
325 <!-- stand-alone combining marks at end of the target text -->
326 <test-case id=
"test67" strength=
"TERTIARY">
327 <pattern>\u0301
</pattern>
328 <pre>abcd\r
</pre><m>\u0301
</m>
331 <!-- attached combining marks at end of the target text, no match -->
332 <test-case id=
"test68" strength=
"TERTIARY">
333 <pattern>\u0301
</pattern>
334 <pre>abcd\u0301
</pre>
339 <!-- no match within expansions at the start -->
340 <test-case id=
"test70" strength=
"PRIMARY">
341 <pattern>Eligature
</pattern>
345 <test-case id=
"test71" strength=
"PRIMARY">
346 <pattern>AEligature
</pattern>
350 <test-case id=
"test72" strength=
"PRIMARY">
351 <pattern>AEligature
</pattern>
355 <!-- unattached combining Tilde will not match a Tilde that is
356 part of a composed Ñ (\u00D1) -->
357 <test-case id=
"test73" strength=
"SECONDARY">
358 <pattern>\u0303
</pattern> <!-- combining tilde -->
359 <pre>Ñ

</pre><m>\u0303
</m>
362 <test-case id=
"test74" strength=
"SECONDARY">
363 <pattern>\u0303
</pattern> <!-- combining tilde -->
364 <pre>Ñ

</pre><m>\u0303
</m><post>a
</post>
367 <test-case id=
"test75" strength=
"TERTIARY" locale=
"fr">
368 <pattern>\u00EA
</pattern>
369 <pre>p
</pre><m>\u00EA
</m><post>che
</post>
372 <test-case id=
"test76" strength=
"TERTIARY" locale=
"fr">
373 <pattern>\u00EA
</pattern>
374 <pre>p
</pre><m>e\u0302
</m><post>che
</post>
377 <test-case id=
"test77" strength=
"TERTIARY" locale=
"fr">
378 <pattern>e\u0302
</pattern>
379 <pre>p
</pre><m>\u00EA
</m><post>che
</post>
382 <!-- Test cases from ticket:5382 -->
383 <test-case id=
"test78" strength=
"SECONDARY" locale=
"hu_HU">
384 <pattern>\u0170
</pattern>
389 <test-case id=
"test79" strength=
"SECONDARY" locale=
"hu_HU">
390 <pattern>\u0170
</pattern>
396 <test-case id=
"test80" strength=
"SECONDARY" locale=
"hu_HU">
397 <pattern>\u0170
</pattern>
402 <!-- Test cases from ticket:5959 -->
403 <test-case id=
"test81" strength=
"SECONDARY">
404 <pattern>\u2166
</pattern>
408 <test-case id=
"test82" strength=
"SECONDARY">
409 <pattern>VII
</pattern>
412 </stringsearch-tests>