• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# © 2017 and later: Unicode, Inc. and others.
2# License & terms of use: http://www.unicode.org/copyright.html
3#
4# Data-driven test for the language/locale matcher.
5# Format:
6#
7# Everything after "#" is a comment.
8# ** test: This line starts a group of test cases.
9#
10# Lines starting with an '@' sign provide matcher parameters.
11# @supported=<comma-separated supported languages>
12# @default=<default language>  # no value = no explicit default
13# @favor=[normal|script]  # no value = no explicit setting
14# @threshold=<number 0..100>  # no value = no explicit setting
15#
16# A line with ">>" is a getBestMatch() test case:
17# <comma-separated desired languages> >> match | desired | combined
18# - match is the expected best supported language
19# - desired is the expected best desired language
20# - combined is the expected result of combine(match, desired)
21# An expected language can be "null" to check for the matcher returning null.
22# An empty or omitted value is not tested. (Omitted = not even the '|' separator.)
23#
24# ** test: A new test group resets all matcher parameters.
25
26## X
27
28** test: testParentLocales
29
30# es-419, es-AR, and es-MX are in a cluster; es is in a different one
31
32@supported=es-419, es-ES
33es-AR >> es-419
34@supported=es-ES, es-419
35es-AR >> es-419
36
37@supported=es-419, es
38es-AR >> es-419
39@supported=es, es-419
40es-AR >> es-419
41
42@supported=es-MX, es
43es-AR >> es-MX
44@supported=es, es-MX
45es-AR >> es-MX
46
47# en-GB, en-AU, and en-NZ are in a cluster; en in a different one
48
49@supported=en-GB, en-US
50en-AU >> en-GB
51@supported=en-US, en-GB
52en-AU >> en-GB
53
54@supported=en-GB, en
55en-AU >> en-GB
56@supported=en, en-GB
57en-AU >> en-GB
58
59@supported=en-NZ, en-US
60en-AU >> en-NZ
61@supported=en-US, en-NZ
62en-AU >> en-NZ
63
64@supported=en-NZ, en
65en-AU >> en-NZ
66@supported=en, en-NZ
67en-AU >> en-NZ
68
69# pt-AU and pt-PT in one cluster; pt-BR in another
70
71@supported=pt-PT, pt-BR
72pt-AO >> pt-PT
73@supported=pt-BR, pt-PT
74pt-AO >> pt-PT
75
76@supported=pt-PT, pt
77pt-AO >> pt-PT
78@supported=pt, pt-PT
79pt-AO >> pt-PT
80
81@supported=zh-MO, zh-TW
82zh-HK >> zh-MO
83@supported=zh-TW, zh-MO
84zh-HK >> zh-MO
85
86@supported=zh-MO, zh-CN
87zh-HK >> zh-MO
88@supported=zh-CN, zh-MO
89zh-HK >> zh-MO
90
91@supported=zh-MO, zh
92zh-HK >> zh-MO
93@supported=zh, zh-MO
94zh-HK >> zh-MO
95
96@favor=script
97@supported=es-419, es-ES
98es-AR >> es-419
99@supported=es-ES, es-419
100es-AR >> es-419
101@supported=es-419, es
102es-AR >> es-419
103@supported=es, es-419
104es-AR >> es-419
105@supported=es-MX, es
106es-AR >> es-MX
107@supported=es, es-MX
108es-AR >> es-MX
109@supported=en-GB, en-US
110en-AU >> en-GB
111@supported=en-US, en-GB
112en-AU >> en-GB
113@supported=en-GB, en
114en-AU >> en-GB
115@supported=en, en-GB
116en-AU >> en-GB
117@supported=en-NZ, en-US
118en-AU >> en-NZ
119@supported=en-US, en-NZ
120en-AU >> en-NZ
121@supported=en-NZ, en
122en-AU >> en-NZ
123@supported=en, en-NZ
124en-AU >> en-NZ
125@supported=pt-PT, pt-BR
126pt-AO >> pt-PT
127@supported=pt-BR, pt-PT
128pt-AO >> pt-PT
129@supported=pt-PT, pt
130pt-AO >> pt-PT
131@supported=pt, pt-PT
132pt-AO >> pt-PT
133@supported=zh-MO, zh-TW
134zh-HK >> zh-MO
135@supported=zh-TW, zh-MO
136zh-HK >> zh-MO
137@supported=zh-MO, zh-CN
138zh-HK >> zh-MO
139@supported=zh-CN, zh-MO
140zh-HK >> zh-MO
141@supported=zh-MO, zh
142zh-HK >> zh-MO
143@supported=zh, zh-MO
144zh-HK >> zh-MO
145
146** test: testChinese
147
148@supported=zh-CN, zh-TW, iw
149zh-Hant-TW >> zh-TW
150zh-Hant >> zh-TW
151zh-TW >> zh-TW
152zh-Hans-CN >> zh-CN
153zh-CN >> zh-CN
154zh >> zh-CN
155
156@favor=script
157zh-Hant-TW >> zh-TW
158zh-Hant >> zh-TW
159zh-TW >> zh-TW
160zh-Hans-CN >> zh-CN
161zh-CN >> zh-CN
162zh >> zh-CN
163
164** test: testenGB
165
166@supported=fr, en, en-GB, es-419, es-MX, es
167en-NZ >> en-GB
168es-ES >> es
169es-AR >> es-419
170es-MX >> es-MX
171
172@favor=script
173en-NZ >> en-GB
174es-ES >> es
175es-AR >> es-419
176es-MX >> es-MX
177
178** test: testFallbacks
179
180@supported=91, en, hi
181sa >> hi
182
183@favor=script
184sa >> hi
185
186** test: testBasics
187
188@supported=fr, en-GB, en
189en-GB >> en-GB
190en >> en
191fr >> fr
192ja >> fr # return first if no match
193
194@favor=script
195en-GB >> en-GB
196en >> en
197fr >> fr
198ja >> fr
199
200** test: testFallback
201
202# check that script fallbacks are handled right
203
204@supported=zh-CN, zh-TW, iw
205zh-Hant >> zh-TW
206zh >> zh-CN
207zh-Hans-CN >> zh-CN
208zh-Hant-HK >> zh-TW
209he-IT >> iw
210
211@favor=script
212zh-Hant >> zh-TW
213zh >> zh-CN
214zh-Hans-CN >> zh-CN
215zh-Hant-HK >> zh-TW
216he-IT >> iw
217
218** test: testSpecials
219
220# check that nearby languages are handled
221
222@supported=en, fil, ro, nn
223tl >> fil
224mo >> ro
225nb >> nn
226
227# make sure default works
228
229ja >> en
230
231@favor=script
232tl >> fil
233mo >> ro
234nb >> nn
235ja >> en
236
237** test: testRegionalSpecials
238
239# verify that en-AU is closer to en-GB than to en (which is en-US)
240
241@supported=en, en-GB, es, es-419
242es-MX >> es-419
243en-AU >> en-GB
244es-ES >> es
245
246@favor=script
247es-MX >> es-419
248en-AU >> en-GB
249es-ES >> es
250
251** test: testHK
252
253# HK and MO are closer to each other for Hant than to TW
254
255@supported=zh, zh-TW, zh-MO
256zh-HK >> zh-MO
257@supported=zh, zh-TW, zh-HK
258zh-MO >> zh-HK
259
260@favor=script
261@supported=zh, zh-TW, zh-MO
262zh-HK >> zh-MO
263@supported=zh, zh-TW, zh-HK
264zh-MO >> zh-HK
265
266** test: testMatch-matchOnMazimized
267
268@supported=zh, zh-Hant
269und-TW >> zh-Hant # und-TW should be closer to zh-Hant than to zh
270
271@supported=en-Hant-TW, und-TW
272zh-Hant >> und-TW # zh-Hant should be closer to und-TW than to en-Hant-TW
273zh >> en-Hant-TW # no match so get first
274
275@favor=script
276@supported=zh, zh-Hant
277und-TW >> zh-Hant
278@supported=en-Hant-TW, und-TW
279zh-Hant >> und-TW
280zh >> en-Hant-TW # no match so get first
281
282** test: testMatchLegacyCode
283
284@supported=fr, i-klingon, en-Latn-US
285en-GB-oed >> en-Latn-US
286
287@favor=script
288en-GB-oed >> en-Latn-US
289
290** test: testGetBestMatchForList-exactMatch
291@supported=fr, en-GB, ja, es-ES, es-MX
292ja, de >> ja
293
294@favor=script
295ja, de >> ja
296
297** test: testGetBestMatchForList-simpleVariantMatch
298@supported=fr, en-GB, ja, es-ES, es-MX
299de, en-US >> en-GB # Intentionally avoiding a perfect-match or two candidates for variant matches.
300
301# Fallback.
302
303de, zh >> fr
304
305@favor=script
306de, en-US >> en-GB
307de, zh >> fr
308
309** test: testGetBestMatchForList-matchOnMaximized
310# Check that if the preference is maximized already, it works as well.
311
312@supported=en, ja
313ja-Jpan-JP, en-AU >> ja # Match for ja-Jpan-JP (maximized already)
314
315# ja-JP matches ja on likely subtags, and it's listed first, thus it wins over the second preference en-GB.
316
317ja-JP, en-US >> ja # Match for ja-Jpan-JP (maximized already)
318
319# Check that if the preference is maximized already, it works as well.
320
321ja-Jpan-JP, en-US >> ja # Match for ja-Jpan-JP (maximized already)
322
323@favor=script
324ja-Jpan-JP, en-AU >> ja
325ja-JP, en-US >> ja
326ja-Jpan-JP, en-US >> ja
327
328** test: testGetBestMatchForList-noMatchOnMaximized
329# Regression test for http://b/5714572 .
330# de maximizes to de-DE. Pick the exact match for the secondary language instead.
331@supported=en, de, fr, ja
332de-CH, fr >> de
333
334@favor=script
335de-CH, fr >> de
336
337** test: testBestMatchForTraditionalChinese
338
339# Scenario: An application that only supports Simplified Chinese (and some other languages),
340# but does not support Traditional Chinese. zh-Hans-CN could be replaced with zh-CN, zh, or
341# zh-Hans, it wouldn't make much of a difference.
342
343# The script distance (simplified vs. traditional Han) is considered small enough
344# to be an acceptable match. The regional difference is considered almost insignificant.
345
346@supported=fr, zh-Hans-CN, en-US
347zh-TW >> fr # no match so get first
348zh-Hant >> fr # no match so get first
349
350# For geopolitical reasons, you might want to avoid a zh-Hant -> zh-Hans match.
351# In this case, if zh-TW, zh-HK or a tag starting with zh-Hant is requested, you can
352# change your call to getBestMatch to include a 2nd language preference.
353# "en" is a better match since its distance to "en-US" is closer than the distance
354# from "zh-TW" to "zh-CN" (script distance).
355
356zh-TW, en >> en-US
357zh-Hant-CN, en >> en-US
358zh-Hans, en >> zh-Hans-CN
359
360@favor=script
361zh-TW >> fr # no match so get first
362zh-Hant >> fr # no match so get first
363zh-TW, en >> en-US
364zh-Hant-CN, en >> en-US
365zh-Hans, en >> zh-Hans-CN
366
367** test: testUndefined
368# When the undefined language doesn't match anything in the list,
369# getBestMatch returns the default, as usual.
370
371@supported=it, fr
372und >> it
373
374# When it *does* occur in the list, bestMatch returns it, as expected.
375@supported=it, und
376und >> und
377
378# The unusual part: max("und") = "en-Latn-US", and since matching is based on maximized
379# tags, the undefined language would normally match English. But that would produce the
380# counterintuitive results that getBestMatch("und", XLocaleMatcher("it,en")) would be "en", and
381# getBestMatch("en", XLocaleMatcher("it,und")) would be "und".
382
383# To avoid that, we change the matcher's definitions of max
384# so that max("und")="und". That produces the following, more desirable
385# results:
386
387@supported=it, en
388und >> it
389@supported=it, und
390en >> it
391
392@favor=script
393@supported=it, fr
394und >> it
395@supported=it, und
396und >> und
397@supported=it, en
398und >> it
399@supported=it, und
400en >> it
401
402** test: testGetBestMatch-regionDistance
403
404@supported=es-AR, es
405es-MX >> es-AR
406@supported=fr, en, en-GB
407en-CA >> en
408@supported=de-AT, de-DE, de-CH
409de >> de-DE
410
411@favor=script
412@supported=es-AR, es
413es-MX >> es-AR
414@supported=fr, en, en-GB
415en-CA >> en
416@supported=de-AT, de-DE, de-CH
417de >> de-DE
418
419** test: testAsymmetry
420
421@supported=mul, nl
422af >> nl # af => nl
423@supported=mul, af
424nl >> mul # but nl !=> af
425
426@favor=script
427@supported=mul, nl
428af >> nl
429@supported=mul, af
430nl >> mul
431
432** test: testGetBestMatchForList-matchOnMaximized2
433
434# ja-JP matches ja on likely subtags, and it's listed first, thus it wins over the second preference en-GB.
435
436@supported=fr, en-GB, ja, es-ES, es-MX
437ja-JP, en-GB >> ja # Match for ja-JP, with likely region subtag
438
439# Check that if the preference is maximized already, it works as well.
440
441ja-Jpan-JP, en-GB >> ja # Match for ja-Jpan-JP (maximized already)
442
443@favor=script
444ja-JP, en-GB >> ja
445ja-Jpan-JP, en-GB >> ja
446
447** test: testGetBestMatchForList-closeEnoughMatchOnMaximized
448
449@supported=en-GB, en, de, fr, ja
450de-CH, fr >> de
451en-US, ar, nl, de, ja >> en
452
453@favor=script
454de-CH, fr >> de
455en-US, ar, nl, de, ja >> en
456
457** test: testGetBestMatchForPortuguese
458
459# pt might be supported and not pt-PT
460
461# European user who prefers Spanish over Brazilian Portuguese as a fallback.
462
463@supported=pt-PT, pt-BR, es, es-419
464pt-PT, es, pt >> pt-PT
465@supported=pt-PT, pt, es, es-419
466pt-PT, es, pt >> pt-PT # pt implicit
467
468# Brazilian user who prefers South American Spanish over European Portuguese as a fallback.
469# The asymmetry between this case and above is because it's "pt-PT" that's missing between the
470# matchers as "pt-BR" is a much more common language.
471
472@supported=pt-PT, pt-BR, es, es-419
473pt, es-419, pt-PT >> pt-BR
474pt-PT, es, pt >> pt-PT
475@supported=pt-PT, pt, es, es-419
476pt-PT, es, pt >> pt-PT
477pt, es-419, pt-PT >> pt
478
479@supported=pt-BR, es, es-419
480pt, es-419, pt-PT >> pt-BR
481
482# Code that adds the user's country can get "pt-US" for a user's language.
483# That should fall back to "pt-BR".
484
485@supported=pt-PT, pt-BR, es, es-419
486pt-US, pt-PT >> pt-BR
487@supported=pt-PT, pt, es, es-419
488pt-US, pt-PT, pt >> pt # pt-BR implicit
489
490@favor=script
491@supported=pt-PT, pt-BR, es, es-419
492pt-PT, es, pt >> pt-PT
493@supported=pt-PT, pt, es, es-419
494pt-PT, es, pt >> pt-PT
495
496@supported=pt-PT, pt-BR, es, es-419
497pt, es-419, pt-PT >> pt-BR
498pt-PT, es, pt >> pt-PT
499@supported=pt-PT, pt, es, es-419
500pt-PT, es, pt >> pt-PT
501pt, es-419, pt-PT >> pt
502
503@supported=pt-BR, es, es-419
504pt, es-419, pt-PT >> pt-BR
505
506@supported=pt-PT, pt-BR, es, es-419
507pt-US, pt-PT >> pt-BR
508@supported=pt-PT, pt, es, es-419
509pt-US, pt-PT, pt >> pt
510
511** test: testVariantWithScriptMatch 1 and 2
512
513@supported=fr, en, sv
514en-GB >> en
515@supported=en, sv
516en-GB, sv >> en
517
518@favor=script
519@supported=fr, en, sv
520en-GB >> en
521@supported=en, sv
522en-GB, sv >> en
523
524** test: testLongLists
525
526@supported=en, sv
527sv >> sv
528
529@supported=af, am, ar, az, be, bg, bn, bs, ca, cs, cy, da, de, el, en, en-GB, es, es-419, et, eu, fa, fi, fil, fr, ga, gl, gu, hi, hr, hu, hy, id, is, it, iw, ja, ka, kk, km, kn, ko, ky, lo, lt, lv, mk, ml, mn, mr, ms, my, ne, nl, no, pa, pl, pt, pt-PT, ro, ru, si, sk, sl, sq, sr, sr-Latn, sv, sw, ta, te, th, tr, uk, ur, uz, vi, zh-CN, zh-TW, zu
530sv >> sv
531
532@supported=af, af-NA, af-ZA, agq, agq-CM, ak, ak-GH, am, am-ET, ar, ar-001, ar-AE, ar-BH, ar-DJ, ar-DZ, ar-EG, ar-EH, ar-ER, ar-IL, ar-IQ, ar-JO, ar-KM, ar-KW, ar-LB, ar-LY, ar-MA, ar-MR, ar-OM, ar-PS, ar-QA, ar-SA, ar-SD, ar-SO, ar-SS, ar-SY, ar-TD, ar-TN, ar-YE, as, as-IN, asa, asa-TZ, ast, ast-ES, az, az-Cyrl, az-Cyrl-AZ, az-Latn, az-Latn-AZ, bas, bas-CM, be, be-BY, bem, bem-ZM, bez, bez-TZ, bg, bg-BG, bm, bm-ML, bn, bn-BD, bn-IN, bo, bo-CN, bo-IN, br, br-FR, brx, brx-IN, bs, bs-Cyrl, bs-Cyrl-BA, bs-Latn, bs-Latn-BA, ca, ca-AD, ca-ES, ca-ES-VALENCIA, ca-FR, ca-IT, ce, ce-RU, cgg, cgg-UG, chr, chr-US, ckb, ckb-IQ, ckb-IR, cs, cs-CZ, cu, cu-RU, cy, cy-GB, da, da-DK, da-GL, dav, dav-KE, de, de-AT, de-BE, de-CH, de-DE, de-LI, de-LU, dje, dje-NE, dsb, dsb-DE, dua, dua-CM, dyo, dyo-SN, dz, dz-BT, ebu, ebu-KE, ee, ee-GH, ee-TG, el, el-CY, el-GR, en, en-001, en-150, en-AG, en-AI, en-AS, en-AT, en-AU, en-BB, en-BE, en-BI, en-BM, en-BS, en-BW, en-BZ, en-CA, en-CC, en-CH, en-CK, en-CM, en-CX, en-CY, en-DE, en-DG, en-DK, en-DM, en-ER, en-FI, en-FJ, en-FK, en-FM, en-GB, en-GD, en-GG, en-GH, en-GI, en-GM, en-GU, en-GY, en-HK, en-IE, en-IL, en-IM, en-IN, en-IO, en-JE, en-JM, en-KE, en-KI, en-KN, en-KY, en-LC, en-LR, en-LS, en-MG, en-MH, en-MO, en-MP, en-MS, en-MT, en-MU, en-MW, en-MY, en-NA, en-NF, en-NG, en-NL, en-NR, en-NU, en-NZ, en-PG, en-PH, en-PK, en-PN, en-PR, en-PW, en-RW, en-SB, en-SC, en-SD, en-SE, en-SG, en-SH, en-SI, en-SL, en-SS, en-SX, en-SZ, en-TC, en-TK, en-TO, en-TT, en-TV, en-TZ, en-UG, en-UM, en-US, en-US-POSIX, en-VC, en-VG, en-VI, en-VU, en-WS, en-ZA, en-ZM, en-ZW, eo, eo-001, es, es-419, es-AR, es-BO, es-CL, es-CO, es-CR, es-CU, es-DO, es-EA, es-EC, es-ES, es-GQ, es-GT, es-HN, es-IC, es-MX, es-NI, es-PA, es-PE, es-PH, es-PR, es-PY, es-SV, es-US, es-UY, es-VE, et, et-EE, eu, eu-ES, ewo, ewo-CM, fa, fa-AF, fa-IR, ff, ff-CM, ff-GN, ff-MR, ff-SN, fi, fi-FI, fil, fil-PH, fo, fo-DK, fo-FO, fr, fr-BE, fr-BF, fr-BI, fr-BJ, fr-BL, fr-CA, fr-CD, fr-CF, fr-CG, fr-CH, fr-CI, fr-CM, fr-DJ, fr-DZ, fr-FR, fr-GA, fr-GF, fr-GN, fr-GP, fr-GQ, fr-HT, fr-KM, fr-LU, fr-MA, fr-MC, fr-MF, fr-MG, fr-ML, fr-MQ, fr-MR, fr-MU, fr-NC, fr-NE, fr-PF, fr-PM, fr-RE, fr-RW, fr-SC, fr-SN, fr-SY, fr-TD, fr-TG, fr-TN, fr-VU, fr-WF, fr-YT, fur, fur-IT, fy, fy-NL, ga, ga-IE, gd, gd-GB, gl, gl-ES, gsw, gsw-CH, gsw-FR, gsw-LI, gu, gu-IN, guz, guz-KE, gv, gv-IM, ha, ha-GH, ha-NE, ha-NG, haw, haw-US, he, he-IL, hi, hi-IN, hr, hr-BA, hr-HR, hsb, hsb-DE, hu, hu-HU, hy, hy-AM, id, id-ID, ig, ig-NG, ii, ii-CN, is, is-IS, it, it-CH, it-IT, it-SM, ja, ja-JP, jgo, jgo-CM, jmc, jmc-TZ, ka, ka-GE, kab, kab-DZ, kam, kam-KE, kde, kde-TZ, kea, kea-CV, khq, khq-ML, ki, ki-KE, kk, kk-KZ, kkj, kkj-CM, kl, kl-GL, kln, kln-KE, km, km-KH, kn, kn-IN, ko, ko-KP, ko-KR, kok, kok-IN, ks, ks-IN, ksb, ksb-TZ, ksf, ksf-CM, ksh, ksh-DE, kw, kw-GB, ky, ky-KG, lag, lag-TZ, lb, lb-LU, lg, lg-UG, lkt, lkt-US, ln, ln-AO, ln-CD, ln-CF, ln-CG, lo, lo-LA, lrc, lrc-IQ, lrc-IR, lt, lt-LT, lu, lu-CD, luo, luo-KE, luy, luy-KE, lv, lv-LV, mas, mas-KE, mas-TZ, mer, mer-KE, mfe, mfe-MU, mg, mg-MG, mgh, mgh-MZ, mgo, mgo-CM, mk, mk-MK, ml, ml-IN, mn, mn-MN, mr, mr-IN, ms, ms-BN, ms-MY, ms-SG, mt, mt-MT, mua, mua-CM, my, my-MM, mzn, mzn-IR, naq, naq-NA, nb, nb-NO, nb-SJ, nd, nd-ZW, ne, ne-IN, ne-NP, nl, nl-AW, nl-BE, nl-BQ, nl-CW, nl-NL, nl-SR, nl-SX, nmg, nmg-CM, nn, nn-NO, nnh, nnh-CM, nus, nus-SS, nyn, nyn-UG, om, om-ET, om-KE, or, or-IN, os, os-GE, os-RU, pa, pa-Arab, pa-Arab-PK, pa-Guru, pa-Guru-IN, pl, pl-PL, prg, prg-001, ps, ps-AF, pt, pt-AO, pt-BR, pt-CV, pt-GW, pt-MO, pt-MZ, pt-PT, pt-ST, pt-TL, qu, qu-BO, qu-EC, qu-PE, rm, rm-CH, rn, rn-BI, ro, ro-MD, ro-RO, rof, rof-TZ, root, ru, ru-BY, ru-KG, ru-KZ, ru-MD, ru-RU, ru-UA, rw, rw-RW, rwk, rwk-TZ, sah, sah-RU, saq, saq-KE, sbp, sbp-TZ, se, se-FI, se-NO, se-SE, seh, seh-MZ, ses, ses-ML, sg, sg-CF, shi, shi-Latn, shi-Latn-MA, shi-Tfng, shi-Tfng-MA, si, si-LK, sk, sk-SK, sl, sl-SI, smn, smn-FI, sn, sn-ZW, so, so-DJ, so-ET, so-KE, so-SO, sq, sq-AL, sq-MK, sq-XK, sr, sr-Cyrl, sr-Cyrl-BA, sr-Cyrl-ME, sr-Cyrl-RS, sr-Cyrl-XK, sr-Latn, sr-Latn-BA, sr-Latn-ME, sr-Latn-RS, sr-Latn-XK, sv, sv-AX, sv-FI, sv-SE, sw, sw-CD, sw-KE, sw-TZ, sw-UG, ta, ta-IN, ta-LK, ta-MY, ta-SG, te, te-IN, teo, teo-KE, teo-UG, th, th-TH, ti, ti-ER, ti-ET, tk, tk-TM, to, to-TO, tr, tr-CY, tr-TR, twq, twq-NE, tzm, tzm-MA, ug, ug-CN, uk, uk-UA, ur, ur-IN, ur-PK, uz, uz-Arab, uz-Arab-AF, uz-Cyrl, uz-Cyrl-UZ, uz-Latn, uz-Latn-UZ, vai, vai-Latn, vai-Latn-LR, vai-Vaii, vai-Vaii-LR, vi, vi-VN, vo, vo-001, vun, vun-TZ, wae, wae-CH, xog, xog-UG, yav, yav-CM, yi, yi-001, yo, yo-BJ, yo-NG, zgh, zgh-MA, zh, zh-Hans, zh-Hans-CN, zh-Hans-HK, zh-Hans-MO, zh-Hans-SG, zh-Hant, zh-Hant-HK, zh-Hant-MO, zh-Hant-TW, zu, zu-ZA
533sv >> sv
534
535@favor=script
536@supported=en, sv
537sv >> sv
538
539@supported=af, am, ar, az, be, bg, bn, bs, ca, cs, cy, da, de, el, en, en-GB, es, es-419, et, eu, fa, fi, fil, fr, ga, gl, gu, hi, hr, hu, hy, id, is, it, iw, ja, ka, kk, km, kn, ko, ky, lo, lt, lv, mk, ml, mn, mr, ms, my, ne, nl, no, pa, pl, pt, pt-PT, ro, ru, si, sk, sl, sq, sr, sr-Latn, sv, sw, ta, te, th, tr, uk, ur, uz, vi, zh-CN, zh-TW, zu
540sv >> sv
541
542@supported=af, af-NA, af-ZA, agq, agq-CM, ak, ak-GH, am, am-ET, ar, ar-001, ar-AE, ar-BH, ar-DJ, ar-DZ, ar-EG, ar-EH, ar-ER, ar-IL, ar-IQ, ar-JO, ar-KM, ar-KW, ar-LB, ar-LY, ar-MA, ar-MR, ar-OM, ar-PS, ar-QA, ar-SA, ar-SD, ar-SO, ar-SS, ar-SY, ar-TD, ar-TN, ar-YE, as, as-IN, asa, asa-TZ, ast, ast-ES, az, az-Cyrl, az-Cyrl-AZ, az-Latn, az-Latn-AZ, bas, bas-CM, be, be-BY, bem, bem-ZM, bez, bez-TZ, bg, bg-BG, bm, bm-ML, bn, bn-BD, bn-IN, bo, bo-CN, bo-IN, br, br-FR, brx, brx-IN, bs, bs-Cyrl, bs-Cyrl-BA, bs-Latn, bs-Latn-BA, ca, ca-AD, ca-ES, ca-ES-VALENCIA, ca-FR, ca-IT, ce, ce-RU, cgg, cgg-UG, chr, chr-US, ckb, ckb-IQ, ckb-IR, cs, cs-CZ, cu, cu-RU, cy, cy-GB, da, da-DK, da-GL, dav, dav-KE, de, de-AT, de-BE, de-CH, de-DE, de-LI, de-LU, dje, dje-NE, dsb, dsb-DE, dua, dua-CM, dyo, dyo-SN, dz, dz-BT, ebu, ebu-KE, ee, ee-GH, ee-TG, el, el-CY, el-GR, en, en-001, en-150, en-AG, en-AI, en-AS, en-AT, en-AU, en-BB, en-BE, en-BI, en-BM, en-BS, en-BW, en-BZ, en-CA, en-CC, en-CH, en-CK, en-CM, en-CX, en-CY, en-DE, en-DG, en-DK, en-DM, en-ER, en-FI, en-FJ, en-FK, en-FM, en-GB, en-GD, en-GG, en-GH, en-GI, en-GM, en-GU, en-GY, en-HK, en-IE, en-IL, en-IM, en-IN, en-IO, en-JE, en-JM, en-KE, en-KI, en-KN, en-KY, en-LC, en-LR, en-LS, en-MG, en-MH, en-MO, en-MP, en-MS, en-MT, en-MU, en-MW, en-MY, en-NA, en-NF, en-NG, en-NL, en-NR, en-NU, en-NZ, en-PG, en-PH, en-PK, en-PN, en-PR, en-PW, en-RW, en-SB, en-SC, en-SD, en-SE, en-SG, en-SH, en-SI, en-SL, en-SS, en-SX, en-SZ, en-TC, en-TK, en-TO, en-TT, en-TV, en-TZ, en-UG, en-UM, en-US, en-US-POSIX, en-VC, en-VG, en-VI, en-VU, en-WS, en-ZA, en-ZM, en-ZW, eo, eo-001, es, es-419, es-AR, es-BO, es-CL, es-CO, es-CR, es-CU, es-DO, es-EA, es-EC, es-ES, es-GQ, es-GT, es-HN, es-IC, es-MX, es-NI, es-PA, es-PE, es-PH, es-PR, es-PY, es-SV, es-US, es-UY, es-VE, et, et-EE, eu, eu-ES, ewo, ewo-CM, fa, fa-AF, fa-IR, ff, ff-CM, ff-GN, ff-MR, ff-SN, fi, fi-FI, fil, fil-PH, fo, fo-DK, fo-FO, fr, fr-BE, fr-BF, fr-BI, fr-BJ, fr-BL, fr-CA, fr-CD, fr-CF, fr-CG, fr-CH, fr-CI, fr-CM, fr-DJ, fr-DZ, fr-FR, fr-GA, fr-GF, fr-GN, fr-GP, fr-GQ, fr-HT, fr-KM, fr-LU, fr-MA, fr-MC, fr-MF, fr-MG, fr-ML, fr-MQ, fr-MR, fr-MU, fr-NC, fr-NE, fr-PF, fr-PM, fr-RE, fr-RW, fr-SC, fr-SN, fr-SY, fr-TD, fr-TG, fr-TN, fr-VU, fr-WF, fr-YT, fur, fur-IT, fy, fy-NL, ga, ga-IE, gd, gd-GB, gl, gl-ES, gsw, gsw-CH, gsw-FR, gsw-LI, gu, gu-IN, guz, guz-KE, gv, gv-IM, ha, ha-GH, ha-NE, ha-NG, haw, haw-US, he, he-IL, hi, hi-IN, hr, hr-BA, hr-HR, hsb, hsb-DE, hu, hu-HU, hy, hy-AM, id, id-ID, ig, ig-NG, ii, ii-CN, is, is-IS, it, it-CH, it-IT, it-SM, ja, ja-JP, jgo, jgo-CM, jmc, jmc-TZ, ka, ka-GE, kab, kab-DZ, kam, kam-KE, kde, kde-TZ, kea, kea-CV, khq, khq-ML, ki, ki-KE, kk, kk-KZ, kkj, kkj-CM, kl, kl-GL, kln, kln-KE, km, km-KH, kn, kn-IN, ko, ko-KP, ko-KR, kok, kok-IN, ks, ks-IN, ksb, ksb-TZ, ksf, ksf-CM, ksh, ksh-DE, kw, kw-GB, ky, ky-KG, lag, lag-TZ, lb, lb-LU, lg, lg-UG, lkt, lkt-US, ln, ln-AO, ln-CD, ln-CF, ln-CG, lo, lo-LA, lrc, lrc-IQ, lrc-IR, lt, lt-LT, lu, lu-CD, luo, luo-KE, luy, luy-KE, lv, lv-LV, mas, mas-KE, mas-TZ, mer, mer-KE, mfe, mfe-MU, mg, mg-MG, mgh, mgh-MZ, mgo, mgo-CM, mk, mk-MK, ml, ml-IN, mn, mn-MN, mr, mr-IN, ms, ms-BN, ms-MY, ms-SG, mt, mt-MT, mua, mua-CM, my, my-MM, mzn, mzn-IR, naq, naq-NA, nb, nb-NO, nb-SJ, nd, nd-ZW, ne, ne-IN, ne-NP, nl, nl-AW, nl-BE, nl-BQ, nl-CW, nl-NL, nl-SR, nl-SX, nmg, nmg-CM, nn, nn-NO, nnh, nnh-CM, nus, nus-SS, nyn, nyn-UG, om, om-ET, om-KE, or, or-IN, os, os-GE, os-RU, pa, pa-Arab, pa-Arab-PK, pa-Guru, pa-Guru-IN, pl, pl-PL, prg, prg-001, ps, ps-AF, pt, pt-AO, pt-BR, pt-CV, pt-GW, pt-MO, pt-MZ, pt-PT, pt-ST, pt-TL, qu, qu-BO, qu-EC, qu-PE, rm, rm-CH, rn, rn-BI, ro, ro-MD, ro-RO, rof, rof-TZ, root, ru, ru-BY, ru-KG, ru-KZ, ru-MD, ru-RU, ru-UA, rw, rw-RW, rwk, rwk-TZ, sah, sah-RU, saq, saq-KE, sbp, sbp-TZ, se, se-FI, se-NO, se-SE, seh, seh-MZ, ses, ses-ML, sg, sg-CF, shi, shi-Latn, shi-Latn-MA, shi-Tfng, shi-Tfng-MA, si, si-LK, sk, sk-SK, sl, sl-SI, smn, smn-FI, sn, sn-ZW, so, so-DJ, so-ET, so-KE, so-SO, sq, sq-AL, sq-MK, sq-XK, sr, sr-Cyrl, sr-Cyrl-BA, sr-Cyrl-ME, sr-Cyrl-RS, sr-Cyrl-XK, sr-Latn, sr-Latn-BA, sr-Latn-ME, sr-Latn-RS, sr-Latn-XK, sv, sv-AX, sv-FI, sv-SE, sw, sw-CD, sw-KE, sw-TZ, sw-UG, ta, ta-IN, ta-LK, ta-MY, ta-SG, te, te-IN, teo, teo-KE, teo-UG, th, th-TH, ti, ti-ER, ti-ET, tk, tk-TM, to, to-TO, tr, tr-CY, tr-TR, twq, twq-NE, tzm, tzm-MA, ug, ug-CN, uk, uk-UA, ur, ur-IN, ur-PK, uz, uz-Arab, uz-Arab-AF, uz-Cyrl, uz-Cyrl-UZ, uz-Latn, uz-Latn-UZ, vai, vai-Latn, vai-Latn-LR, vai-Vaii, vai-Vaii-LR, vi, vi-VN, vo, vo-001, vun, vun-TZ, wae, wae-CH, xog, xog-UG, yav, yav-CM, yi, yi-001, yo, yo-BJ, yo-NG, zgh, zgh-MA, zh, zh-Hans, zh-Hans-CN, zh-Hans-HK, zh-Hans-MO, zh-Hans-SG, zh-Hant, zh-Hant-HK, zh-Hant-MO, zh-Hant-TW, zu, zu-ZA
543sv >> sv
544
545** test: test8288
546
547@supported=it, en
548und >> it
549und, en >> en
550
551# examples from
552# http://unicode.org/repos/cldr/tags/latest/common/bcp47/
553# http://unicode.org/repos/cldr/tags/latest/common/validity/variant.xml
554
555@favor=script
556und >> it
557und, en >> en
558
559** test: testUnHack
560
561@supported=en-NZ, en-IT
562en-US >> en-NZ
563
564@favor=script
565en-US >> en-NZ
566
567** test: testEmptySupported => null
568en >> null
569
570# testVariantsAndExtensions
571
572** test: tests the .combine() method
573
574@supported=und, fr
575fr-BE-fonipa >> fr | | fr-BE-fonipa
576@supported=und, fr-CA
577fr-BE-fonipa >> fr-CA | | fr-BE-fonipa
578@supported=und, fr-fonupa
579fr-BE-fonipa >> fr-fonupa | | fr-BE-fonipa
580@supported=und, no
581nn-BE-fonipa >> no | | no-BE-fonipa
582@supported=und, en-GB-u-sd-gbsct
583en-fonipa-u-nu-Arab-ca-buddhist-t-m0-iso-i0-pinyin >> en-GB-u-sd-gbsct | | en-GB-fonipa-u-nu-Arab-ca-buddhist-t-m0-iso-i0-pinyin
584
585@supported=en-PSCRACK, de-PSCRACK, fr-PSCRACK, pt-PT-PSCRACK
586fr-PSCRACK >> fr-PSCRACK
587fr >> en-PSCRACK
588de-CH >> en-PSCRACK
589
590@favor=script
591@supported=und, fr
592fr-BE-fonipa >> fr
593@supported=und, fr-CA
594fr-BE-fonipa >> fr-CA
595@supported=und, fr-fonupa
596fr-BE-fonipa >> fr-fonupa
597@supported=und, no
598nn-BE-fonipa >> no | | no-BE-fonipa
599@supported=und, en-GB-u-sd-gbsct
600en-fonipa-u-nu-Arab-ca-buddhist-t-m0-iso-i0-pinyin >> en-GB-u-sd-gbsct | | en-GB-fonipa-u-nu-Arab-ca-buddhist-t-m0-iso-i0-pinyin
601
602@supported=en-PSCRACK, de-PSCRACK, fr-PSCRACK, pt-PT-PSCRACK
603fr-PSCRACK >> fr-PSCRACK
604fr >> en-PSCRACK
605de-CH >> en-PSCRACK
606
607** test: testClusters
608# we favor es-419 over others in cluster. Clusters: es- {ES, MA, EA} {419, AR, MX}
609
610@supported=und, es, es-MA, es-MX, es-419
611es-AR >> es-419
612@supported=und, es-MA, es, es-419, es-MX
613es-AR >> es-419
614@supported=und, es, es-MA, es-MX, es-419
615es-EA >> es
616@supported=und, es-MA, es, es-419, es-MX
617es-EA >> es
618
619# of course, fall back to within cluster
620
621@supported=und, es, es-MA, es-MX
622es-AR >> es-MX
623@supported=und, es-MA, es, es-MX
624es-AR >> es-MX
625@supported=und, es-MA, es-MX, es-419
626es-EA >> es-MA
627@supported=und, es-MA, es-419, es-MX
628es-EA >> es-MA
629
630# we favor es-GB over others in cluster. Clusters: en- {US, GU, VI} {GB, IN, ZA}
631
632@supported=und, en, en-GU, en-IN, en-GB
633en-ZA >> en-GB
634@supported=und, en-GU, en, en-GB, en-IN
635en-ZA >> en-GB
636@supported=und, en, en-GU, en-IN, en-GB
637en-VI >> en
638@supported=und, en-GU, en, en-GB, en-IN
639en-VI >> en
640
641# of course, fall back to within cluster
642
643@supported=und, en, en-GU, en-IN
644en-ZA >> en-IN
645@supported=und, en-GU, en, en-IN
646en-ZA >> en-IN
647@supported=und, en-GU, en-IN, en-GB
648en-VI >> en-GU
649@supported=und, en-GU, en-GB, en-IN
650en-VI >> en-GU
651
652@favor=script
653@supported=und, es, es-MA, es-MX, es-419
654es-AR >> es-419
655@supported=und, es-MA, es, es-419, es-MX
656es-AR >> es-419
657@supported=und, es, es-MA, es-MX, es-419
658es-EA >> es
659@supported=und, es-MA, es, es-419, es-MX
660es-EA >> es
661
662@supported=und, es, es-MA, es-MX
663es-AR >> es-MX
664@supported=und, es-MA, es, es-MX
665es-AR >> es-MX
666@supported=und, es-MA, es-MX, es-419
667es-EA >> es-MA
668@supported=und, es-MA, es-419, es-MX
669es-EA >> es-MA
670
671@supported=und, en, en-GU, en-IN, en-GB
672en-ZA >> en-GB
673@supported=und, en-GU, en, en-GB, en-IN
674en-ZA >> en-GB
675@supported=und, en, en-GU, en-IN, en-GB
676en-VI >> en
677@supported=und, en-GU, en, en-GB, en-IN
678en-VI >> en
679
680@supported=und, en, en-GU, en-IN
681en-ZA >> en-IN
682@supported=und, en-GU, en, en-IN
683en-ZA >> en-IN
684@supported=und, en-GU, en-IN, en-GB
685en-VI >> en-GU
686@supported=und, en-GU, en-GB, en-IN
687en-VI >> en-GU
688
689** test: testThreshold
690@supported=50, und, fr-CA-fonupa
691@threshold=60
692fr-BE-fonipa >> fr-CA-fonupa | | fr-BE-fonipa
693@supported=und, fr-Cyrl-CA-fonupa
694fr-BE-fonipa >> fr-Cyrl-CA-fonupa | | fr-Cyrl-BE-fonipa
695@threshold=50
696fr-BE-fonipa >> und
697
698@favor=script
699@supported=50, und, fr-CA-fonupa
700@threshold=
701fr-BE-fonipa >> fr-CA-fonupa | | fr-BE-fonipa
702@supported=und, fr-Cyrl-CA-fonupa
703fr-BE-fonipa >> und
704
705** test: testScriptFirst
706@supported=ru, fr
707zh, pl >> ru
708zh-Cyrl, pl >> ru
709@supported=hr, en-Cyrl
710sr >> hr
711@supported=da, ru, hr
712sr >> da
713
714@favor=script
715@supported=ru, fr
716zh, pl >> fr
717zh-Cyrl, pl >> ru
718@supported=hr, en-Cyrl
719sr >> en-Cyrl
720@supported=da, ru, hr
721sr >> ru
722
723## III
724
725** test: testBasicsWithDefault
726@supported=en-GB, en
727@default=fr
728en-GB >> en-GB
729en-US >> en
730fr >> fr
731ja >> fr
732
733@favor=script
734en-GB >> en-GB
735en-US >> en
736fr >> en
737ja >> fr
738
739** test: testEmptyWithDefault
740@default=en
741fr >> en
742
743** test: testGetBestMatchForList_exactMatch
744@supported=fr, en-GB, ja, es-ES, es-MX
745ja, de >> ja
746
747** test: testGetBestMatchForList_simpleVariantMatch
748# Intentionally avoiding a perfect-match or two candidates for variant matches.
749@supported=fr, en-GB, ja, es-ES, es-MX
750de, en-US >> en-GB
751# Fall back.
752de, zh >> fr
753
754** test: TestEuHack
755@supported=en-NZ, en-IT
756en-US >> en-NZ
757
758** test: TestBasics
759@supported=fr, en-GB, en
760en-GB >> en-GB
761en-US >> en
762fr-FR >> fr
763ja-JP >> fr
764zu >> en
765# For a language that doesn't match anything, return the default.
766zxx >> fr
767
768@favor=script
769en-GB >> en-GB
770en-US >> en
771fr-FR >> fr
772ja-JP >> fr
773zu >> en
774zxx >> en
775
776** test: TestExactMatch
777@supported=fr, en-GB, ja, es-ES, es-MX
778ja, de >> ja
779
780** test: TestSimpleVariantMatch
781@supported=fr, en-GB, ja, es-ES, es-MX
782de, en-US >> en-GB
783de, zh >> fr
784
785** test: TestMatchOnMaximized
786# ja-JP matches ja on likely subtags, and it's listed first, thus it wins
787# over the secondary preference en-GB.
788@supported=fr, en-GB, ja, es-ES, es-MX
789ja-JP, en-GB >> ja
790# Check that if the preference is maximized already, it works as well.
791ja-Jpan-JP, en-GB >> ja
792@supported=fr, zh-Hant, en
793zh, en >> en
794
795@favor=script
796zh, en >> en
797
798** test: TestCloseEnoughMatchOnMaximized
799@supported=en-GB, en, de, fr, ja
800de-CH, fr >> de
801en-US, ar, nl, de, ja >> en
802
803** test: TestGetBestMatchForPortuguese
804# 1. a supported set containing an explicit pt: {pt-PT, pt-BR, es, es-419}
805# 2. a supported set containing an implicit pt: {pt-PT, pt, es, es-419}
806# 3. a supported set containing no pt: {pt-BR, es, es-419}
807# European user who prefers Spanish over Brazilian Portuguese as a fallback.
808@supported=pt-PT, pt-BR, es, es-419
809pt-PT, es, pt >> pt-PT
810@supported=pt-PT, pt, es, es-419
811pt-PT, es, pt >> pt-PT
812@supported=pt-BR, es, es-419
813pt-PT, es, pt >> pt-BR
814
815# Brazilian user who prefers South American Spanish over European Portuguese
816# as a fallback. The asymmetry between this case and above is because it's
817# "pt-PT" that's missing between the matchers.
818@supported=pt-PT, pt-BR, es, es-419
819pt, es-419, pt-PT >> pt-BR
820@supported=pt-PT, pt, es, es-419
821pt, es-419, pt-PT >> pt
822@supported=pt-BR, es, es-419
823pt, es-419, pt-PT >> pt-BR
824
825# Sometimes we get "pt-US" for a user's language (which CLDR doesn't
826# recognize) but we deal with that as a synonym for "pt-BR".
827@supported=pt-PT, pt-BR, es, es-419
828pt-US, pt-PT >> pt-BR
829@supported=pt-PT, pt, es, es-419
830pt-US, pt-PT >> pt
831
832@favor=script
833@supported=pt-BR, es, es-419
834pt-PT, es, pt >> pt-BR
835@supported=pt-PT, pt, es, es-419
836pt-US, pt-PT >> pt
837
838** test: TestScriptAndRegion
839@supported=en-GB, en
840en-CA >> en
841# fr-CA is a "close enough" match to "fr" to be returned in favor of "en-GB"
842@supported=fr, en-GB, en
843fr-CA, en-CA >> fr
844@supported=zh-Hant, zh-TW
845zh-HK >> zh-Hant
846
847@favor=script
848@supported=en-GB, en
849en-CA >> en
850@supported=fr, en-GB, en
851fr-CA, en-CA >> fr
852@supported=zh-Hant, zh-TW
853zh-HK >> zh-Hant
854
855** test: TestFallback
856@supported=zh-CN, zh-TW, iw
857zh-Hant >> zh-TW
858zh >> zh-CN
859zh-Hans-CN >> zh-CN
860zh-Hant-HK >> zh-TW
861he-IT >> iw
862
863** test: TestFallbackWithDefault
864# Check that script fallbacks are handled right and that we don't have to
865# fall back to the default.
866@supported=zh-CN, zh-TW, iw
867@default=fr
868zh-Hant >> zh-TW
869zh >> zh-CN
870zh-Hans-CN >> zh-CN
871zh-Hant-HK >> zh-TW
872he-IT >> iw
873
874@favor=script
875zh-Hant >> zh-TW
876zh >> zh-CN
877zh-Hans-CN >> zh-CN
878zh-Hant-HK >> zh-TW
879he-IT >> iw
880
881** test: TestSpecials
882# Check that nearby languages are handled.
883@supported=en, fil, ro, nn
884tl >> fil
885mo >> ro
886nb >> nn
887ja >> en # Make sure default works.
888
889** test: TestRegionalSpecials
890# Verify that en-AU is closer to en-GB than to en (which is en-US).
891@supported=en, en-GB, es-ES, es-419
892en-AU >> en-GB
893# Following 2 cases test closer/smaller region difference.
894es-MX >> es-419
895es-PT >> es-ES
896
897@favor=script
898en-AU >> en-GB
899es-MX >> es-419
900es-PT >> es-ES
901
902** test: TestEmpty
903fr >> null
904
905** test: TestUndefined
906# When the undefined language doesn't match anything in the list,
907# return the default.
908@supported=it, fr
909und >> it
910# When it *does* occur in the list, return it.
911@supported=it, und
912und >> und
913# The unusual part:
914# max("und") = "en-Latn-US", and since matching is based on
915# maximized tags, the undefined language would normally match
916# English.  But that would produce the counterintuitive results
917# that BestMatchFor("und", LanguageMatcher("it,en")) would be "en",
918# and BestMatchFor("en", LanguageMatcher("it,und")) would be "und".
919
920# To avoid that, we change the matcher's definitions of max
921# (AddLikelySubtagsWithDefaults) so that max("und")="und". That
922# produces the following, more desirable results:
923@supported=it, en
924und >> it
925@supported=it, und
926en >> it
927
928** test: TestVariantWithScriptMatch
929@supported=fr, en, sv
930en-GB >> en
931en-GB, sv >> en
932
933@favor=script
934en-GB, sv >> en
935
936** test: Serbian
937@supported=und, sr
938sr-ME >> sr
939@supported=und, sr-ME
940sr >> sr-ME
941@supported=und, sr-Latn
942bs >> und
943@supported=und, bs
944sr-Latn >> und
945@supported=und, sr
946bs >> und
947@supported=und, bs
948sr >> und
949@supported=und, sr-Latn
950sr >> sr-Latn
951@supported=und, sr
952sr-Latn >> sr
953
954@favor=script
955sr-ME >> sr
956@supported=und, sr-ME
957sr >> sr-ME
958@supported=und, sr-Latn
959bs >> sr-Latn
960@supported=und, bs
961sr-Latn >> bs
962@supported=und, sr
963bs >> und
964@supported=und, bs
965sr >> und
966@supported=und, sr-Latn
967sr >> sr-Latn
968@supported=und, sr
969sr-Latn >> sr
970
971** test: MatchGooglePrivateUseSubtag
972@supported=fr, x-bork, en-Latn-US
973x-piglatin >> fr
974x-bork >> x-bork
975@supported=fr, en-GB, x-bork, es-ES, es-419
976x-piglatin >> fr
977x-bork >> x-bork
978
979@favor=script
980@supported=fr, x-bork, en-Latn-US
981x-piglatin >> x-bork
982x-bork >> x-bork
983@supported=fr, en-GB, x-bork, es-ES, es-419
984x-piglatin >> x-bork
985x-bork >> x-bork
986
987** test: MatchLegacyCode
988@supported=fr, i-klingon, en-Latn-US
989en-GB-oed >> en-Latn-US
990i-klingon >> tlh
991
992@favor=script
993en-GB-oed >> en-Latn-US
994i-klingon >> tlh
995
996** test: MatchGooglePseudoLocale
997# Google pseudo locales using variant subtags.
998# (See below for the region code based pseudo locales.)
999@supported=fr, en-PSACCENT, ar-PSBIDI, en-PSCRACK, zh-Hans-PSCRACK, pt-PT-PSCRACK, pt
1000de >> fr
1001en-US >> fr
1002en >> fr
1003ar-PSBIDI >> ar-PSBIDI
1004en-PSACCENT >> en-PSACCENT
1005en-PSCRACK >> en-PSCRACK
1006pt-BR >> pt
1007pt-PT-PSCRACK >> pt-PT-PSCRACK
1008zh-Hans-PSCRACK >> zh-Hans-PSCRACK
1009
1010@favor=script
1011de >> fr
1012en-US >> fr
1013en >> fr
1014ar-PSBIDI >> ar-PSBIDI
1015en-PSACCENT >> en-PSACCENT
1016en-PSCRACK >> en-PSCRACK
1017pt-BR >> pt
1018pt-PT-PSCRACK >> pt-PT-PSCRACK
1019zh-Hans-PSCRACK >> zh-Hans-PSCRACK
1020
1021** test: MatchGooglePseudoLocaleWithFallbacks
1022# Pseudo locales based on the fall back option (XA..XC region codes).
1023@supported=fr, en-XA, ar-XB, en-XC, zh-Hans-XC, pt
1024de >> fr
1025en-US >> fr
1026en >> fr
1027ar-XB >> ar-XB
1028en-XA >> en-XA
1029en-XC >> en-XC
1030pt-BR >> pt
1031zh-Hans-XC >> zh-Hans-XC
1032
1033@favor=script
1034de >> fr
1035en-US >> fr
1036en >> fr
1037ar-XB >> ar-XB
1038en-XA >> en-XA
1039en-XC >> en-XC
1040pt-BR >> pt
1041zh-Hans-XC >> zh-Hans-XC
1042
1043** test: DoNotMatchGooglePseudoLocale
1044@supported=fr, en-XA, ar-XB, en-PSACCENT, ar-PSBIDI, en-DE, pt, ar-SY, ar-PSCRACK
1045de >> fr
1046# We wouldn't want to return pseudo locales when there's a good match for an
1047# ordinary locale.
1048# Note: If LanguageMatcher was not aware of PSACCENT, it would consider the
1049# distance from "en" to "en-PSACCENT" smaller than to "en-DE" (the standard
1050# variant distance is smaller than a region distance).
1051en >> en-DE
1052ar-EG >> ar-SY
1053pt-BR >> pt
1054ar-XB >> ar-XB
1055ar-PSBIDI >> ar-PSBIDI
1056en-XA >> en-XA
1057en-PSACCENT >> en-PSACCENT
1058ar-PSCRACK >> ar-PSCRACK
1059
1060@favor=script
1061de >> en-DE
1062en >> en-DE
1063ar-EG >> ar-SY
1064pt-BR >> pt
1065ar-XB >> ar-XB
1066ar-PSBIDI >> ar-PSBIDI
1067en-XA >> en-XA
1068en-PSACCENT >> en-PSACCENT
1069ar-PSCRACK >> ar-PSCRACK
1070
1071** test: BestMatchForTraditionalChinese
1072# Scenario: An application that only supports Simplified Chinese (and some
1073# other languages), but does not support Traditional Chinese. zh-Hans-CN
1074# could be replaced with zh-CN, zh, or zh-Hans, it wouldn't make much of a
1075# difference.
1076# The script distance (simplified vs. traditional Han) is considered small
1077# enough to be an acceptable match. The regional difference is considered
1078# almost insignificant.
1079@supported=fr, zh-Hans-CN, en-US
1080zh-TW >> fr # no match so get first
1081zh-Hant >> fr # no match so get first
1082
1083# For geopolitical reasons, you might want to avoid a zh-Hant -> zh-Hans
1084# match. In this case, if zh-TW, zh-HK or a tag starting with zh-Hant is
1085# requested, you can change your call to getBestMatch to include a 2nd
1086# language preference. "en" is a better match since its distance to "en-US"
1087# is closer than the distance from "zh-TW" to "zh-CN" (script distance).
1088zh-TW, en >> en-US
1089zh-Hant-CN, en >> en-US
1090zh-Hans, en >> zh-Hans-CN
1091
1092** test: MaxBeforeEquals
1093# Compare maximized forms of earlier items before testing equality
1094# of later items.
1095@supported=en, fr-CA
1096en-US, fr-CA >> en
1097
1098@favor=script
1099en-US, fr-CA >> en
1100
1101** test: SiblingDefaultRegion
1102@supported=de-AT, de-DE, de-CH
1103de >> de-DE
1104
1105** test: ReturnDefaultInsteadOfNullForEmptyPriorityList
1106@default=und
1107de >> und
1108
1109** test: ReturnSpecifiedDefaultForNoMatch
1110@supported=de, en, fr
1111@default=und
1112hi >> und
1113
1114@favor=script
1115hi >> und
1116
1117** test: MatchedLanguageIgnoresDefault
1118@supported=de, en, fr
1119@default=und
1120fr >> fr
1121
1122@favor=script
1123fr >> fr
1124
1125## GenX
1126
1127** test: TwoSpanishes
1128@supported=es, es-MX
1129@default=und
1130es-001 >> es
1131und >> und
1132ca >> es
1133gl-ES >> es
1134es >> es
1135es-MX >> es-MX
1136es-002 >> es
1137es-003 >> es-MX
1138es-005 >> es-MX
1139es-019 >> es-MX
1140es-029 >> es-MX
1141es-419 >> es-MX
1142es-142 >> es
1143es-150 >> es
1144es-AD >> es
1145es-AR >> es-MX
1146es-BO >> es-MX
1147es-BZ >> es-MX
1148es-CA >> es-MX
1149es-CL >> es-MX
1150es-CO >> es-MX
1151es-CR >> es-MX
1152es-CU >> es-MX
1153es-DO >> es-MX
1154es-EC >> es-MX
1155es-ES >> es
1156es-GI >> es
1157es-GQ >> es
1158es-GT >> es-MX
1159es-HN >> es-MX
1160es-NI >> es-MX
1161es-PA >> es-MX
1162es-PE >> es-MX
1163es-PH >> es
1164es-PR >> es-MX
1165es-PY >> es-MX
1166es-SV >> es-MX
1167es-US >> es-MX
1168es-UY >> es-MX
1169es-VE >> es-MX
1170
1171@favor=script
1172es-001 >> es
1173und >> und
1174ca >> es
1175gl-ES >> es
1176es >> es
1177es-MX >> es-MX
1178es-002 >> es
1179es-003 >> es-MX
1180es-005 >> es-MX
1181es-019 >> es-MX
1182es-029 >> es-MX
1183es-419 >> es-MX
1184es-142 >> es
1185es-150 >> es
1186es-AD >> es
1187es-AR >> es-MX
1188es-BO >> es-MX
1189es-BZ >> es-MX
1190es-CA >> es-MX
1191es-CL >> es-MX
1192es-CO >> es-MX
1193es-CR >> es-MX
1194es-CU >> es-MX
1195es-DO >> es-MX
1196es-EC >> es-MX
1197es-ES >> es
1198es-GI >> es
1199es-GQ >> es
1200es-GT >> es-MX
1201es-HN >> es-MX
1202es-NI >> es-MX
1203es-PA >> es-MX
1204es-PE >> es-MX
1205es-PH >> es
1206es-PR >> es-MX
1207es-PY >> es-MX
1208es-SV >> es-MX
1209es-US >> es-MX
1210es-UY >> es-MX
1211es-VE >> es-MX
1212
1213** test: Three Spanishes
1214@supported=es, es-419, es-MX
1215@default=und
1216es-001 >> es
1217und >> und
1218ca >> es
1219gl-ES >> es
1220es >> es
1221es-419 >> es-419
1222es-002 >> es
1223es-003 >> es-419
1224es-005 >> es-419
1225es-019 >> es-419
1226es-029 >> es-419
1227es-142 >> es
1228es-150 >> es
1229es-AD >> es
1230es-AR >> es-419
1231es-BO >> es-419
1232es-BZ >> es-419
1233es-CA >> es-419
1234es-CL >> es-419
1235es-CO >> es-419
1236es-CR >> es-419
1237es-CU >> es-419
1238es-DO >> es-419
1239es-EC >> es-419
1240es-ES >> es
1241es-GI >> es
1242es-GQ >> es
1243es-GT >> es-419
1244es-HN >> es-419
1245es-MX >> es-MX
1246es-NI >> es-419
1247es-PA >> es-419
1248es-PE >> es-419
1249es-PH >> es
1250es-PR >> es-419
1251es-PY >> es-419
1252es-SV >> es-419
1253es-US >> es-419
1254es-UY >> es-419
1255es-VE >> es-419
1256
1257@favor=script
1258es-001 >> es
1259und >> und
1260ca >> es
1261gl-ES >> es
1262es >> es
1263es-419 >> es-419
1264es-002 >> es
1265es-003 >> es-419
1266es-005 >> es-419
1267es-019 >> es-419
1268es-029 >> es-419
1269es-142 >> es
1270es-150 >> es
1271es-AD >> es
1272es-AR >> es-419
1273es-BO >> es-419
1274es-BZ >> es-419
1275es-CA >> es-419
1276es-CL >> es-419
1277es-CO >> es-419
1278es-CR >> es-419
1279es-CU >> es-419
1280es-DO >> es-419
1281es-EC >> es-419
1282es-ES >> es
1283es-GI >> es
1284es-GQ >> es
1285es-GT >> es-419
1286es-HN >> es-419
1287es-MX >> es-MX
1288es-NI >> es-419
1289es-PA >> es-419
1290es-PE >> es-419
1291es-PH >> es
1292es-PR >> es-419
1293es-PY >> es-419
1294es-SV >> es-419
1295es-US >> es-419
1296es-UY >> es-419
1297es-VE >> es-419
1298
1299** test: Englishes
1300@supported=en-GB, en-US
1301@default=und
1302und >> und
1303ja >> und
1304fr-CA >> und
1305
1306# Great Britain fallback
1307en-AU >> en-GB
1308en-BZ >> en-GB
1309en-IN >> en-GB
1310en-IE >> en-GB
1311en-JM >> en-GB
1312en-NZ >> en-GB
1313en-PK >> en-GB
1314en-TT >> en-GB
1315en-ZA >> en-GB
1316
1317# United States fallback
1318en-CA >> en-US
1319en-US >> en-US
1320en >> en-US
1321
1322@favor=script
1323und >> und
1324ja >> und
1325fr-CA >> en-US
1326en-AU >> en-GB
1327en-BZ >> en-GB
1328en-CA >> en-US
1329en-IN >> en-GB
1330en-IE >> en-GB
1331en-JM >> en-GB
1332en-NZ >> en-GB
1333en-PK >> en-GB
1334en-TT >> en-GB
1335en-ZA >> en-GB
1336en-US >> en-US
1337en >> en-US
1338
1339** test: TestFallback
1340# manyEnMatcher
1341@supported=en-GB, en-US, en, en-AU
1342@default=und
1343und >> und
1344ja >> und
1345fr-CA >> und
1346
1347# nonUsMatcher
1348fr >> und
1349
1350# onlyAuMatcher
1351@supported=en-AU, ja, ca
1352fr >> und
1353
1354# noEnMatcher
1355@supported=pl, ja, ca
1356fr >> und
1357
1358@favor=script
1359@supported=en-GB, en-US, en, en-AU
1360und >> und
1361ja >> und
1362fr-CA >> en-US
1363fr >> en-US
1364@supported=en-AU, ja, ca
1365fr >> en-AU
1366@supported=pl, ja, ca
1367fr >> pl
1368
1369## Go
1370
1371** test: basics
1372@supported=fr, en-GB, en
1373en-GB >> en-GB
1374en-US >> en
1375fr-FR >> fr
1376ja-JP >> fr
1377
1378** test: script fallbacks
1379@supported=zh-CN, zh-TW, iw
1380zh-Hant >> zh-TW
1381zh >> zh-CN
1382zh-Hans-CN >> zh-CN
1383zh-Hant-HK >> zh-TW
1384@default=iw
1385he-IT >> iw
1386
1387@favor=script
1388he-IT >> iw
1389
1390** test: language-specific script fallbacks 1
1391@supported=en, sr, nl
1392sr-Latn >> sr
1393sh >> en
1394hr >> en
1395bs >> en
1396nl-Cyrl >> en # Mark: Expected value should be en not sr. Script difference exceeds threshold, so can't be nl
1397
1398@favor=script
1399sr-Latn >> sr
1400hr >> en
1401bs >> en
1402nl-Cyrl >> sr
1403
1404** test: language-specific script fallbacks 2
1405@supported=en, sr-Latn
1406sr >> sr-Latn
1407sr-Cyrl >> sr-Latn
1408@default=und
1409hr >> und
1410
1411@favor=script
1412@default=
1413sr >> sr-Latn
1414sr-Cyrl >> sr-Latn
1415@default=und
1416hr >> en
1417
1418** test: don't match hr to sr-Latn
1419@supported=en, sr-Latn
1420hr >> en
1421
1422@favor=script
1423hr >> en
1424
1425** test: both deprecated and not
1426@supported=fil, tl, iw, he
1427he-IT >> iw
1428he >> iw
1429iw >> iw
1430fil-IT >> fil
1431fil >> fil
1432tl >> fil
1433
1434@favor=script
1435he-IT >> iw
1436he >> iw
1437iw >> iw
1438fil-IT >> fil
1439fil >> fil
1440tl >> fil
1441
1442** test: nearby languages: Nynorsk to Bokmål
1443@supported=en, nb
1444nn >> nb
1445
1446@favor=script
1447nn >> nb
1448
1449** test: nearby languages: Danish does not match nn
1450@supported=en, nn
1451da >> en
1452
1453@favor=script
1454da >> en
1455
1456** test: nearby languages: Danish matches no
1457@supported=en, no
1458da >> no
1459
1460@favor=script
1461da >> no
1462
1463** test: nearby languages: Danish matches nb
1464@supported=en, nb
1465da >> nb
1466
1467** test: prefer matching languages over language variants. Get en-GB, should get nn?
1468@supported=nn, en-GB
1469no, en-US >> en-GB
1470nb, en-US >> en-GB
1471
1472@favor=script
1473no, en-US >> nn
1474nb, en-US >> nn
1475
1476** test: deprecated version is closer than same language with other differences
1477@supported=nl, he, en-GB
1478iw, en-US >> he
1479
1480@favor=script
1481iw, en-US >> he
1482
1483** test: macro equivalent is closer than same language with other differences
1484@supported=nl, zh, en-GB, no
1485cmn, en-US >> zh
1486nb, en-US >> no
1487
1488@favor=script
1489cmn, en-US >> zh
1490nb, en-US >> no
1491
1492** test: legacy equivalent is closer than same language with other differences
1493@supported=nl, fil, en-GB
1494tl, en-US >> fil
1495
1496@favor=script
1497tl, en-US >> fil
1498
1499** test: distinguish near equivalents
1500@supported=en, ro, mo, ro-MD
1501ro >> ro
1502mo >> ro # ro=mo for the locale matcher
1503ro-MD >> ro-MD
1504
1505@favor=script
1506ro >> ro
1507mo >> ro # ro=mo for the locale matcher
1508ro-MD >> ro-MD
1509
1510** test: maximization of legacy
1511@supported=sr-Cyrl, sr-Latn, ro, ro-MD
1512sh >> sr-Latn
1513mo >> ro
1514
1515@favor=script
1516sh >> sr-Latn
1517mo >> ro
1518
1519** test: empty
1520fr >> null
1521en >> null
1522
1523** test: private use subtags
1524@supported=fr, en-GB, x-bork, es-ES, es-419
1525x-piglatin >> fr
1526x-bork >> x-bork
1527
1528** test: legacy codes
1529@supported=fr, i-klingon, en-Latn-US
1530en-GB-oed >> en-Latn-US
1531i-klingon >> tlh
1532
1533
1534** test: simple variant match
1535@supported=fr, en-GB, ja, es-ES, es-MX
1536de, en-US >> en-GB
1537de, zh >> fr
1538
1539** test: best match for traditional Chinese
1540@supported=fr, zh-Hans-CN, en-US
1541zh-TW >> fr # no match so get first
1542zh-Hant >> fr # no match so get first
1543zh-TW, en >> en-US
1544zh-Hant-CN, en >> en-US
1545zh-Hans, en >> zh-Hans-CN
1546
1547** test: return most originally similar among likely-subtags equivalent locales
1548@supported=af, af-Latn, af-Arab
1549af >> af
1550af-ZA >> af
1551af-Latn-ZA >> af-Latn
1552af-Latn >> af-Latn
1553
1554@favor=script
1555af >> af
1556af-ZA >> af
1557af-Latn-ZA >> af-Latn
1558af-Latn >> af-Latn
1559
1560@supported=nl, nl-NL, nl-BE
1561@favor=
1562nl >> nl
1563nl-Latn >> nl
1564nl-Latn-NL >> nl-NL
1565nl-NL >> nl-NL
1566
1567@favor=script
1568nl >> nl
1569nl-Latn >> nl
1570nl-Latn-NL >> nl-NL
1571nl-NL >> nl-NL
1572
1573@supported=nl, nl-Latn, nl-NL, nl-BE
1574@favor=
1575nl >> nl
1576nl-Latn >> nl-Latn
1577nl-NL >> nl-NL
1578nl-Latn-NL >> nl-Latn
1579
1580@favor=script
1581nl >> nl
1582nl-Latn >> nl-Latn
1583nl-NL >> nl-NL
1584nl-Latn-NL >> nl-Latn
1585
1586** test: region may replace matched if matched is enclosing
1587@supported=es-419, es
1588@default=es-MX
1589es-MX >> es-419
1590@default=
1591es-SG >> es
1592
1593@favor=script
1594@default=es-MX
1595es-MX >> es-419
1596@default=
1597es-SG >> es
1598
1599** test: region distance Portuguese
1600@supported=pt, pt-PT
1601pt-ES >> pt-PT
1602
1603@favor=script
1604pt-ES >> pt-PT
1605
1606** test: if no preferred locale specified, pick top language, not regional
1607@supported=en, fr, fr-CA, fr-CH
1608fr-US >> fr
1609
1610@favor=script
1611fr-US >> fr
1612
1613** test: region distance German
1614@supported=de-AT, de-DE, de-CH
1615de >> de-DE
1616
1617** test: en-AU is closer to en-GB than to en (which is en-US)
1618@supported=en, en-GB, es-ES, es-419
1619en-AU >> en-GB
1620@default=es-MX
1621es-MX >> es-419
1622@default=
1623es-PT >> es-ES
1624
1625@favor=script
1626en-AU >> en-GB
1627es-MX >> es-419
1628@default=
1629es-PT >> es-ES
1630
1631** test: undefined
1632@supported=it, fr
1633und >> it
1634
1635** test: und does not match en
1636@supported=it, en
1637und >> it
1638
1639** test: undefined in priority list
1640@supported=it, und
1641und >> und
1642en >> it
1643
1644** test: undefined
1645@supported=it, fr, zh
1646und-FR >> fr
1647und-CN >> zh
1648und-Hans >> zh
1649und-Hant >> it # no match so get first
1650und-Latn >> it
1651
1652@favor=script
1653und-FR >> fr
1654und-CN >> zh
1655und-Hans >> zh
1656und-Hant >> it # no match so get first
1657und-Latn >> it
1658
1659** test: match on maximized tag
1660@supported=fr, en-GB, ja, es-ES, es-MX
1661ja-JP, en-GB >> ja
1662ja-Jpan-JP, en-GB >> ja
1663
1664** test: pick best maximized tag
1665@supported=ja, ja-Jpan-US, ja-JP, en, ru
1666ja-Jpan, ru >> ja
1667ja-JP, ru >> ja-JP
1668ja-US, ru >> ja-Jpan-US
1669
1670@favor=script
1671ja-Jpan, ru >> ja
1672ja-JP, ru >> ja-JP
1673ja-US, ru >> ja-Jpan-US
1674
1675** test: termination: pick best maximized match
1676@supported=ja, ja-Jpan, ja-JP, en, ru
1677ja-Jpan-JP, ru >> ja-Jpan
1678ja-Jpan, ru >> ja-Jpan
1679
1680@favor=script
1681ja-Jpan-JP, ru >> ja-Jpan
1682ja-Jpan, ru >> ja-Jpan
1683
1684** test: same language over exact, but distinguish when user is explicit
1685@supported=fr, en-GB, ja, es-ES, es-MX
1686ja, de >> ja
1687@supported=en, de, fr, ja
1688de-CH, fr >> de
1689@supported=en-GB, nl
1690en, nl >> en-GB
1691en, nl, en-GB >> en-GB
1692
1693@favor=script
1694@supported=fr, en-GB, ja, es-ES, es-MX
1695ja, de >> ja
1696@supported=en, de, fr, ja
1697de-CH, fr >> de
1698@supported=en-GB, nl
1699en, nl >> en-GB
1700en, nl, en-GB >> en-GB
1701
1702** test: parent relation preserved
1703@supported=en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK
1704en-150 >> en-GB
1705en-AU >> en-GB
1706en-BE >> en-GB
1707en-GG >> en-GB
1708en-GI >> en-GB
1709en-HK >> en-GB
1710en-IE >> en-GB
1711en-IM >> en-GB
1712en-IN >> en-GB
1713en-JE >> en-GB
1714en-MT >> en-GB
1715en-NZ >> en-GB
1716en-PK >> en-GB
1717en-SG >> en-GB
1718en-DE >> en-GB
1719@default=es-AR
1720es-AR >> es-419
1721@default=es-BO
1722es-BO >> es-419
1723@default=es-CL
1724es-CL >> es-419
1725@default=es-CO
1726es-CO >> es-419
1727@default=es-CR
1728es-CR >> es-419
1729@default=es-CU
1730es-CU >> es-419
1731@default=es-DO
1732es-DO >> es-419
1733@default=es-EC
1734es-EC >> es-419
1735@default=es-GT
1736es-GT >> es-419
1737@default=es-HN
1738es-HN >> es-419
1739@default=es-MX
1740es-MX >> es-419
1741@default=es-NI
1742es-NI >> es-419
1743@default=es-PA
1744es-PA >> es-419
1745@default=es-PE
1746es-PE >> es-419
1747@default=es-PR
1748es-PR >> es-419
1749@default=
1750es-PT >> es
1751@default=es-PY
1752es-PY >> es-419
1753@default=es-SV
1754es-SV >> es-419
1755@default=
1756es-US >> es-419
1757@default=es-UY
1758es-UY >> es-419
1759@default=es-VE
1760es-VE >> es-419
1761@default=
1762pt-AO >> pt-PT
1763pt-CV >> pt-PT
1764pt-GW >> pt-PT
1765pt-MO >> pt-PT
1766pt-MZ >> pt-PT
1767pt-ST >> pt-PT
1768pt-TL >> pt-PT
1769
1770@favor=script
1771en-150 >> en-GB
1772en-AU >> en-GB
1773en-BE >> en-GB
1774en-GG >> en-GB
1775en-GI >> en-GB
1776en-HK >> en-GB
1777en-IE >> en-GB
1778en-IM >> en-GB
1779en-IN >> en-GB
1780en-JE >> en-GB
1781en-MT >> en-GB
1782en-NZ >> en-GB
1783en-PK >> en-GB
1784en-SG >> en-GB
1785en-DE >> en-GB
1786@default=es-AR
1787es-AR >> es-419
1788@default=es-BO
1789es-BO >> es-419
1790@default=es-CL
1791es-CL >> es-419
1792@default=es-CO
1793es-CO >> es-419
1794@default=es-CR
1795es-CR >> es-419
1796@default=es-CU
1797es-CU >> es-419
1798@default=es-DO
1799es-DO >> es-419
1800@default=es-EC
1801es-EC >> es-419
1802@default=es-GT
1803es-GT >> es-419
1804@default=es-HN
1805es-HN >> es-419
1806@default=es-MX
1807es-MX >> es-419
1808@default=es-NI
1809es-NI >> es-419
1810@default=es-PA
1811es-PA >> es-419
1812@default=es-PE
1813es-PE >> es-419
1814@default=es-PR
1815es-PR >> es-419
1816@default=
1817es-PT >> es
1818@default=es-PY
1819es-PY >> es-419
1820@default=es-SV
1821es-SV >> es-419
1822@default=
1823es-US >> es-419
1824@default=es-UY
1825es-UY >> es-419
1826@default=es-VE
1827es-VE >> es-419
1828@default=
1829pt-AO >> pt-PT
1830pt-CV >> pt-PT
1831pt-GW >> pt-PT
1832pt-MO >> pt-PT
1833pt-MZ >> pt-PT
1834pt-ST >> pt-PT
1835pt-TL >> pt-PT
1836
1837** test: preserve extensions
1838@supported=en, de, sl-NEDIS
1839@default=de-u-co-phonebk
1840de-FR-u-co-phonebk >> de
1841@default=sl-NEDIS-u-cu-eur
1842sl-NEDIS-u-cu-eur >> sl-NEDIS
1843sl-u-cu-eur >> sl-NEDIS
1844sl-HR-NEDIS-u-cu-eur >> sl-NEDIS
1845@default=de-t-m0-iso-i0-pinyin
1846de-t-m0-iso-i0-pinyin >> de
1847
1848@favor=script
1849@default=de-u-co-phonebk
1850de-FR-u-co-phonebk >> de
1851@default=sl-NEDIS-u-cu-eur
1852sl-NEDIS-u-cu-eur >> sl-NEDIS
1853sl-u-cu-eur >> sl-NEDIS
1854sl-HR-NEDIS-u-cu-eur >> sl-NEDIS
1855@default=de-t-m0-iso-i0-pinyin
1856de-t-m0-iso-i0-pinyin >> de
1857
1858## ULS
1859
1860** test: testEmptyUserLanguagesGetsEmpty_getBestMatches
1861@supported=de
1862 >> de
1863
1864** test: testNoStrongMatchGetsEmpty_getBestMatches
1865@supported=de
1866fr >> de
1867
1868@favor=script
1869fr >> de
1870
1871** test: testLooseMatchForGeneral_getBestMatches
1872@supported=es-419
1873es-MX >> es-419
1874
1875@favor=script
1876es-MX >> es-419
1877
1878** test: testLooseMatchForEnglish_getBestMatches
1879@supported=en, en-GB
1880en-CA >> en
1881
1882@favor=script
1883en-CA >> en
1884
1885** test: testLooseMatchForChinese_getBestMatches
1886@supported=zh
1887zh-TW >> zh
1888
1889@favor=script
1890zh-TW >> zh
1891
1892## Geo
1893
1894** test: testGetBestMatchWithMinMatchScore
1895@supported=fr-FR, fr, fr-CA, en
1896@default=und
1897fr >> fr
1898@supported=en, fr, fr-CA
1899fr-FR >> fr # Parent match is chosen.
1900@supported=en, fr-CA
1901fr-FR >> fr-CA # Sibling match is chosen.
1902@supported=fr-CA, fr-FR
1903fr >> fr-FR # Inferred region match is chosen.
1904fr-SN >> fr-FR
1905@supported=en, fr-FR
1906fr >> fr-FR # Child match is chosen.
1907@supported=de, en, it
1908fr >> und
1909@supported=iw, en
1910iw-Latn >> und
1911@supported=iw, no
1912ru >> und
1913@supported=iw-Latn, iw-Cyrl, iw
1914ru >> und
1915@supported=iw, iw-Latn
1916ru >> und
1917en >> und
1918@supported=en, uk
1919ru >> und
1920@supported=zh-TW, en
1921zh-CN >> und # no match
1922@supported=ja
1923ru >> und
1924
1925@favor=script
1926@supported=fr-FR, fr, fr-CA, en
1927fr >> fr
1928@supported=en, fr, fr-CA
1929fr-FR >> fr
1930@supported=en, fr-CA
1931fr-FR >> fr-CA
1932@supported=fr-CA, fr-FR
1933fr >> fr-FR
1934fr-SN >> fr-FR
1935@supported=en, fr-FR
1936fr >> fr-FR
1937@supported=de, en, it
1938fr >> en
1939@supported=iw, en
1940iw-Latn >> en
1941@supported=iw, no
1942ru >> und
1943@supported=iw-Latn, iw-Cyrl, iw
1944ru >> iw-Cyrl
1945@supported=iw, iw-Latn
1946ru >> und
1947en >> iw-Latn
1948@supported=en, uk
1949ru >> uk
1950@supported=zh-TW, en
1951zh-CN >> und # no match
1952@supported=ja
1953ru >> und
1954
1955** test: favor a more-default locale among equally imperfect matches
1956@supported=fr-CA, fr-CH, fr-FR, fr-GB
1957fr-SN >> fr-FR
1958@supported=sr-Latn, sr-Cyrl, sr-Grek
1959@threshold=60
1960sr-Thai >> sr-Cyrl
1961