Annotation of embedaddon/php/ext/intl/tests/locale_filter_matches.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
1.1.1.2 ! misho 2: locale_filter_matches.phpt() icu <= 4.2
1.1 misho 3: --SKIPIF--
4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
1.1.1.2 ! misho 5: <?php if(version_compare(INTL_ICU_VERSION, '4.3', '<') != 1) print 'skip'; ?>
1.1 misho 6: --FILE--
7: <?php
8:
9: /*
10: * Try parsing different Locales
11: * with Procedural and Object methods.
12: */
13:
14: function ut_main()
15: {
16: $loc_ranges = array(
17: 'de-de',
18: 'sl_IT',
19: 'sl_IT_Nedis',
20: 'jbo',
21: 'art-lojban',
22: 'sl_IT'
23: );
24:
25: $lang_tags = array(
26: 'de-DEVA',
27: 'de-DE-1996',
28: 'de-DE',
29: 'zh_Hans',
30: 'de-CH-1996',
31: 'sl_IT',
32: 'sl_IT_nedis-a-kirti-x-xyz',
33: 'sl_IT_rozaj',
34: 'sl_IT_NEDIS_ROJAZ_1901',
35: 'i-enochian',
36: 'sgn-CH-de',
37: 'art-lojban',
38: 'i-lux',
39: 'art-lojban',
40: 'jbo',
41: 'en_sl_IT'
42: );
43:
44: $res_str = '';
45: $isCanonical = false;
46: foreach($loc_ranges as $loc_range){
47: foreach($lang_tags as $lang_tag){
48: $res_str .="--------------\n";
49: $result= ut_loc_locale_filter_matches( $lang_tag , $loc_range , $isCanonical);
50: $res_str .= "loc_range:$loc_range matches lang_tag $lang_tag ? ";
51: if( $result){
52: $res_str .= "YES\n";
53: }else{
54: $res_str .= "NO\n";
55: }
56: //canonicalized version
57: $result= ut_loc_locale_filter_matches( $lang_tag , $loc_range , !($isCanonical));
58: $can_loc_range = ut_loc_canonicalize($loc_range);
59: $can_lang_tag = ut_loc_canonicalize($lang_tag);
60: $res_str .= "loc_range:$can_loc_range canonically matches lang_tag $can_lang_tag ? ";
61: if( $result){
62: $res_str .= "YES\n";
63: }else{
64: $res_str .= "NO\n";
65: }
66: }
67: }
68:
69: $res_str .= "\n";
70: return $res_str;
71:
72: }
73:
74: include_once( 'ut_common.inc' );
75: ut_run();
76:
77: ?>
78: --EXPECT--
79: --------------
80: loc_range:de-de matches lang_tag de-DEVA ? NO
81: loc_range:de_DE canonically matches lang_tag de_Deva ? NO
82: --------------
83: loc_range:de-de matches lang_tag de-DE-1996 ? YES
84: loc_range:de_DE canonically matches lang_tag de_DE_1996 ? YES
85: --------------
86: loc_range:de-de matches lang_tag de-DE ? YES
87: loc_range:de_DE canonically matches lang_tag de_DE ? YES
88: --------------
89: loc_range:de-de matches lang_tag zh_Hans ? NO
90: loc_range:de_DE canonically matches lang_tag zh_Hans ? NO
91: --------------
92: loc_range:de-de matches lang_tag de-CH-1996 ? NO
93: loc_range:de_DE canonically matches lang_tag de_CH_1996 ? NO
94: --------------
95: loc_range:de-de matches lang_tag sl_IT ? NO
96: loc_range:de_DE canonically matches lang_tag sl_IT ? NO
97: --------------
98: loc_range:de-de matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? NO
99: loc_range:de_DE canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? NO
100: --------------
101: loc_range:de-de matches lang_tag sl_IT_rozaj ? NO
102: loc_range:de_DE canonically matches lang_tag sl_IT_ROZAJ ? NO
103: --------------
104: loc_range:de-de matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO
105: loc_range:de_DE canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO
106: --------------
107: loc_range:de-de matches lang_tag i-enochian ? NO
108: loc_range:de_DE canonically matches lang_tag i-enochian ? NO
109: --------------
110: loc_range:de-de matches lang_tag sgn-CH-de ? NO
111: loc_range:de_DE canonically matches lang_tag sgn_CH_DE ? NO
112: --------------
113: loc_range:de-de matches lang_tag art-lojban ? NO
114: loc_range:de_DE canonically matches lang_tag jbo ? NO
115: --------------
116: loc_range:de-de matches lang_tag i-lux ? NO
117: loc_range:de_DE canonically matches lang_tag i-lux ? NO
118: --------------
119: loc_range:de-de matches lang_tag art-lojban ? NO
120: loc_range:de_DE canonically matches lang_tag jbo ? NO
121: --------------
122: loc_range:de-de matches lang_tag jbo ? NO
123: loc_range:de_DE canonically matches lang_tag jbo ? NO
124: --------------
125: loc_range:de-de matches lang_tag en_sl_IT ? NO
126: loc_range:de_DE canonically matches lang_tag en_SL_IT ? NO
127: --------------
128: loc_range:sl_IT matches lang_tag de-DEVA ? NO
129: loc_range:sl_IT canonically matches lang_tag de_Deva ? NO
130: --------------
131: loc_range:sl_IT matches lang_tag de-DE-1996 ? NO
132: loc_range:sl_IT canonically matches lang_tag de_DE_1996 ? NO
133: --------------
134: loc_range:sl_IT matches lang_tag de-DE ? NO
135: loc_range:sl_IT canonically matches lang_tag de_DE ? NO
136: --------------
137: loc_range:sl_IT matches lang_tag zh_Hans ? NO
138: loc_range:sl_IT canonically matches lang_tag zh_Hans ? NO
139: --------------
140: loc_range:sl_IT matches lang_tag de-CH-1996 ? NO
141: loc_range:sl_IT canonically matches lang_tag de_CH_1996 ? NO
142: --------------
143: loc_range:sl_IT matches lang_tag sl_IT ? YES
144: loc_range:sl_IT canonically matches lang_tag sl_IT ? YES
145: --------------
146: loc_range:sl_IT matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? YES
147: loc_range:sl_IT canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? YES
148: --------------
149: loc_range:sl_IT matches lang_tag sl_IT_rozaj ? YES
150: loc_range:sl_IT canonically matches lang_tag sl_IT_ROZAJ ? YES
151: --------------
152: loc_range:sl_IT matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES
153: loc_range:sl_IT canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES
154: --------------
155: loc_range:sl_IT matches lang_tag i-enochian ? NO
156: loc_range:sl_IT canonically matches lang_tag i-enochian ? NO
157: --------------
158: loc_range:sl_IT matches lang_tag sgn-CH-de ? NO
159: loc_range:sl_IT canonically matches lang_tag sgn_CH_DE ? NO
160: --------------
161: loc_range:sl_IT matches lang_tag art-lojban ? NO
162: loc_range:sl_IT canonically matches lang_tag jbo ? NO
163: --------------
164: loc_range:sl_IT matches lang_tag i-lux ? NO
165: loc_range:sl_IT canonically matches lang_tag i-lux ? NO
166: --------------
167: loc_range:sl_IT matches lang_tag art-lojban ? NO
168: loc_range:sl_IT canonically matches lang_tag jbo ? NO
169: --------------
170: loc_range:sl_IT matches lang_tag jbo ? NO
171: loc_range:sl_IT canonically matches lang_tag jbo ? NO
172: --------------
173: loc_range:sl_IT matches lang_tag en_sl_IT ? NO
174: loc_range:sl_IT canonically matches lang_tag en_SL_IT ? NO
175: --------------
176: loc_range:sl_IT_Nedis matches lang_tag de-DEVA ? NO
177: loc_range:sl_IT_NEDIS canonically matches lang_tag de_Deva ? NO
178: --------------
179: loc_range:sl_IT_Nedis matches lang_tag de-DE-1996 ? NO
180: loc_range:sl_IT_NEDIS canonically matches lang_tag de_DE_1996 ? NO
181: --------------
182: loc_range:sl_IT_Nedis matches lang_tag de-DE ? NO
183: loc_range:sl_IT_NEDIS canonically matches lang_tag de_DE ? NO
184: --------------
185: loc_range:sl_IT_Nedis matches lang_tag zh_Hans ? NO
186: loc_range:sl_IT_NEDIS canonically matches lang_tag zh_Hans ? NO
187: --------------
188: loc_range:sl_IT_Nedis matches lang_tag de-CH-1996 ? NO
189: loc_range:sl_IT_NEDIS canonically matches lang_tag de_CH_1996 ? NO
190: --------------
191: loc_range:sl_IT_Nedis matches lang_tag sl_IT ? NO
192: loc_range:sl_IT_NEDIS canonically matches lang_tag sl_IT ? NO
193: --------------
194: loc_range:sl_IT_Nedis matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? YES
195: loc_range:sl_IT_NEDIS canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? YES
196: --------------
197: loc_range:sl_IT_Nedis matches lang_tag sl_IT_rozaj ? NO
198: loc_range:sl_IT_NEDIS canonically matches lang_tag sl_IT_ROZAJ ? NO
199: --------------
200: loc_range:sl_IT_Nedis matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES
201: loc_range:sl_IT_NEDIS canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES
202: --------------
203: loc_range:sl_IT_Nedis matches lang_tag i-enochian ? NO
204: loc_range:sl_IT_NEDIS canonically matches lang_tag i-enochian ? NO
205: --------------
206: loc_range:sl_IT_Nedis matches lang_tag sgn-CH-de ? NO
207: loc_range:sl_IT_NEDIS canonically matches lang_tag sgn_CH_DE ? NO
208: --------------
209: loc_range:sl_IT_Nedis matches lang_tag art-lojban ? NO
210: loc_range:sl_IT_NEDIS canonically matches lang_tag jbo ? NO
211: --------------
212: loc_range:sl_IT_Nedis matches lang_tag i-lux ? NO
213: loc_range:sl_IT_NEDIS canonically matches lang_tag i-lux ? NO
214: --------------
215: loc_range:sl_IT_Nedis matches lang_tag art-lojban ? NO
216: loc_range:sl_IT_NEDIS canonically matches lang_tag jbo ? NO
217: --------------
218: loc_range:sl_IT_Nedis matches lang_tag jbo ? NO
219: loc_range:sl_IT_NEDIS canonically matches lang_tag jbo ? NO
220: --------------
221: loc_range:sl_IT_Nedis matches lang_tag en_sl_IT ? NO
222: loc_range:sl_IT_NEDIS canonically matches lang_tag en_SL_IT ? NO
223: --------------
224: loc_range:jbo matches lang_tag de-DEVA ? NO
225: loc_range:jbo canonically matches lang_tag de_Deva ? NO
226: --------------
227: loc_range:jbo matches lang_tag de-DE-1996 ? NO
228: loc_range:jbo canonically matches lang_tag de_DE_1996 ? NO
229: --------------
230: loc_range:jbo matches lang_tag de-DE ? NO
231: loc_range:jbo canonically matches lang_tag de_DE ? NO
232: --------------
233: loc_range:jbo matches lang_tag zh_Hans ? NO
234: loc_range:jbo canonically matches lang_tag zh_Hans ? NO
235: --------------
236: loc_range:jbo matches lang_tag de-CH-1996 ? NO
237: loc_range:jbo canonically matches lang_tag de_CH_1996 ? NO
238: --------------
239: loc_range:jbo matches lang_tag sl_IT ? NO
240: loc_range:jbo canonically matches lang_tag sl_IT ? NO
241: --------------
242: loc_range:jbo matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? NO
243: loc_range:jbo canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? NO
244: --------------
245: loc_range:jbo matches lang_tag sl_IT_rozaj ? NO
246: loc_range:jbo canonically matches lang_tag sl_IT_ROZAJ ? NO
247: --------------
248: loc_range:jbo matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO
249: loc_range:jbo canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO
250: --------------
251: loc_range:jbo matches lang_tag i-enochian ? NO
252: loc_range:jbo canonically matches lang_tag i-enochian ? NO
253: --------------
254: loc_range:jbo matches lang_tag sgn-CH-de ? NO
255: loc_range:jbo canonically matches lang_tag sgn_CH_DE ? NO
256: --------------
257: loc_range:jbo matches lang_tag art-lojban ? NO
258: loc_range:jbo canonically matches lang_tag jbo ? YES
259: --------------
260: loc_range:jbo matches lang_tag i-lux ? NO
261: loc_range:jbo canonically matches lang_tag i-lux ? NO
262: --------------
263: loc_range:jbo matches lang_tag art-lojban ? NO
264: loc_range:jbo canonically matches lang_tag jbo ? YES
265: --------------
266: loc_range:jbo matches lang_tag jbo ? YES
267: loc_range:jbo canonically matches lang_tag jbo ? YES
268: --------------
269: loc_range:jbo matches lang_tag en_sl_IT ? NO
270: loc_range:jbo canonically matches lang_tag en_SL_IT ? NO
271: --------------
272: loc_range:art-lojban matches lang_tag de-DEVA ? NO
273: loc_range:jbo canonically matches lang_tag de_Deva ? NO
274: --------------
275: loc_range:art-lojban matches lang_tag de-DE-1996 ? NO
276: loc_range:jbo canonically matches lang_tag de_DE_1996 ? NO
277: --------------
278: loc_range:art-lojban matches lang_tag de-DE ? NO
279: loc_range:jbo canonically matches lang_tag de_DE ? NO
280: --------------
281: loc_range:art-lojban matches lang_tag zh_Hans ? NO
282: loc_range:jbo canonically matches lang_tag zh_Hans ? NO
283: --------------
284: loc_range:art-lojban matches lang_tag de-CH-1996 ? NO
285: loc_range:jbo canonically matches lang_tag de_CH_1996 ? NO
286: --------------
287: loc_range:art-lojban matches lang_tag sl_IT ? NO
288: loc_range:jbo canonically matches lang_tag sl_IT ? NO
289: --------------
290: loc_range:art-lojban matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? NO
291: loc_range:jbo canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? NO
292: --------------
293: loc_range:art-lojban matches lang_tag sl_IT_rozaj ? NO
294: loc_range:jbo canonically matches lang_tag sl_IT_ROZAJ ? NO
295: --------------
296: loc_range:art-lojban matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO
297: loc_range:jbo canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO
298: --------------
299: loc_range:art-lojban matches lang_tag i-enochian ? NO
300: loc_range:jbo canonically matches lang_tag i-enochian ? NO
301: --------------
302: loc_range:art-lojban matches lang_tag sgn-CH-de ? NO
303: loc_range:jbo canonically matches lang_tag sgn_CH_DE ? NO
304: --------------
305: loc_range:art-lojban matches lang_tag art-lojban ? YES
306: loc_range:jbo canonically matches lang_tag jbo ? YES
307: --------------
308: loc_range:art-lojban matches lang_tag i-lux ? NO
309: loc_range:jbo canonically matches lang_tag i-lux ? NO
310: --------------
311: loc_range:art-lojban matches lang_tag art-lojban ? YES
312: loc_range:jbo canonically matches lang_tag jbo ? YES
313: --------------
314: loc_range:art-lojban matches lang_tag jbo ? NO
315: loc_range:jbo canonically matches lang_tag jbo ? YES
316: --------------
317: loc_range:art-lojban matches lang_tag en_sl_IT ? NO
318: loc_range:jbo canonically matches lang_tag en_SL_IT ? NO
319: --------------
320: loc_range:sl_IT matches lang_tag de-DEVA ? NO
321: loc_range:sl_IT canonically matches lang_tag de_Deva ? NO
322: --------------
323: loc_range:sl_IT matches lang_tag de-DE-1996 ? NO
324: loc_range:sl_IT canonically matches lang_tag de_DE_1996 ? NO
325: --------------
326: loc_range:sl_IT matches lang_tag de-DE ? NO
327: loc_range:sl_IT canonically matches lang_tag de_DE ? NO
328: --------------
329: loc_range:sl_IT matches lang_tag zh_Hans ? NO
330: loc_range:sl_IT canonically matches lang_tag zh_Hans ? NO
331: --------------
332: loc_range:sl_IT matches lang_tag de-CH-1996 ? NO
333: loc_range:sl_IT canonically matches lang_tag de_CH_1996 ? NO
334: --------------
335: loc_range:sl_IT matches lang_tag sl_IT ? YES
336: loc_range:sl_IT canonically matches lang_tag sl_IT ? YES
337: --------------
338: loc_range:sl_IT matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? YES
339: loc_range:sl_IT canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? YES
340: --------------
341: loc_range:sl_IT matches lang_tag sl_IT_rozaj ? YES
342: loc_range:sl_IT canonically matches lang_tag sl_IT_ROZAJ ? YES
343: --------------
344: loc_range:sl_IT matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES
345: loc_range:sl_IT canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES
346: --------------
347: loc_range:sl_IT matches lang_tag i-enochian ? NO
348: loc_range:sl_IT canonically matches lang_tag i-enochian ? NO
349: --------------
350: loc_range:sl_IT matches lang_tag sgn-CH-de ? NO
351: loc_range:sl_IT canonically matches lang_tag sgn_CH_DE ? NO
352: --------------
353: loc_range:sl_IT matches lang_tag art-lojban ? NO
354: loc_range:sl_IT canonically matches lang_tag jbo ? NO
355: --------------
356: loc_range:sl_IT matches lang_tag i-lux ? NO
357: loc_range:sl_IT canonically matches lang_tag i-lux ? NO
358: --------------
359: loc_range:sl_IT matches lang_tag art-lojban ? NO
360: loc_range:sl_IT canonically matches lang_tag jbo ? NO
361: --------------
362: loc_range:sl_IT matches lang_tag jbo ? NO
363: loc_range:sl_IT canonically matches lang_tag jbo ? NO
364: --------------
365: loc_range:sl_IT matches lang_tag en_sl_IT ? NO
366: loc_range:sl_IT canonically matches lang_tag en_SL_IT ? NO
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>