Annotation of embedaddon/php/ext/intl/tests/locale_lookup_variant2.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: locale_lookup.phpt()
! 3: --SKIPIF--
! 4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
! 5: <?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
! 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: );
! 23:
! 24: $lang_tags = array(
! 25: 'de-DEVA',
! 26: 'de-DE-1996',
! 27: 'de-DE',
! 28: 'zh_Hans',
! 29: 'de-CH-1996',
! 30: 'sl_IT',
! 31: 'sl_IT_nedis-a-kirti-x-xyz',
! 32: 'sl_IT_rozaj',
! 33: 'sl_IT_NEDIS_ROJAZ_1901',
! 34: 'i-enochian',
! 35: 'sgn-CH-de',
! 36: 'art-lojban',
! 37: 'i-lux',
! 38: 'art-lojban',
! 39: 'jbo',
! 40: 'en_sl_IT',
! 41: 'zh-Hant-CN-x-prv1-prv2'
! 42: );
! 43:
! 44:
! 45: $res_str = '';
! 46: $isCanonical = false;
! 47:
! 48: foreach($loc_ranges as $loc_range){
! 49: $res_str .="--------------\n";
! 50: $result= ut_loc_locale_lookup( $lang_tags , $loc_range,$isCanonical,"en_US");
! 51: $comma_arr =implode(",",$lang_tags);
! 52: $res_str .= "loc_range:$loc_range \nlang_tags: $comma_arr\n";
! 53: $res_str .= "\nlookup result:$result\n";
! 54: //canonicalized version
! 55: $result= ut_loc_locale_lookup( $lang_tags , $loc_range,!($isCanonical),"en_US");
! 56: $can_loc_range = ut_loc_canonicalize($loc_range);
! 57: $res_str .= "Canonical lookup result:$result\n";
! 58:
! 59: }
! 60:
! 61: $res_str .= "\n";
! 62: return $res_str;
! 63:
! 64: }
! 65:
! 66: include_once( 'ut_common.inc' );
! 67: ut_run();
! 68:
! 69: ?>
! 70: --EXPECT--
! 71: --------------
! 72: loc_range:de-de
! 73: lang_tags: de-DEVA,de-DE-1996,de-DE,zh_Hans,de-CH-1996,sl_IT,sl_IT_nedis-a-kirti-x-xyz,sl_IT_rozaj,sl_IT_NEDIS_ROJAZ_1901,i-enochian,sgn-CH-de,art-lojban,i-lux,art-lojban,jbo,en_sl_IT,zh-Hant-CN-x-prv1-prv2
! 74:
! 75: lookup result:de-DE
! 76: Canonical lookup result:de_de
! 77: --------------
! 78: loc_range:sl_IT
! 79: lang_tags: de-DEVA,de-DE-1996,de-DE,zh_Hans,de-CH-1996,sl_IT,sl_IT_nedis-a-kirti-x-xyz,sl_IT_rozaj,sl_IT_NEDIS_ROJAZ_1901,i-enochian,sgn-CH-de,art-lojban,i-lux,art-lojban,jbo,en_sl_IT,zh-Hant-CN-x-prv1-prv2
! 80:
! 81: lookup result:sl_IT
! 82: Canonical lookup result:sl_it
! 83: --------------
! 84: loc_range:sl_IT_Nedis
! 85: lang_tags: de-DEVA,de-DE-1996,de-DE,zh_Hans,de-CH-1996,sl_IT,sl_IT_nedis-a-kirti-x-xyz,sl_IT_rozaj,sl_IT_NEDIS_ROJAZ_1901,i-enochian,sgn-CH-de,art-lojban,i-lux,art-lojban,jbo,en_sl_IT,zh-Hant-CN-x-prv1-prv2
! 86:
! 87: lookup result:sl_IT
! 88: Canonical lookup result:sl_it
! 89: --------------
! 90: loc_range:jbo
! 91: lang_tags: de-DEVA,de-DE-1996,de-DE,zh_Hans,de-CH-1996,sl_IT,sl_IT_nedis-a-kirti-x-xyz,sl_IT_rozaj,sl_IT_NEDIS_ROJAZ_1901,i-enochian,sgn-CH-de,art-lojban,i-lux,art-lojban,jbo,en_sl_IT,zh-Hant-CN-x-prv1-prv2
! 92:
! 93: lookup result:jbo
! 94: Canonical lookup result:jbo
! 95: --------------
! 96: loc_range:art-lojban
! 97: lang_tags: de-DEVA,de-DE-1996,de-DE,zh_Hans,de-CH-1996,sl_IT,sl_IT_nedis-a-kirti-x-xyz,sl_IT_rozaj,sl_IT_NEDIS_ROJAZ_1901,i-enochian,sgn-CH-de,art-lojban,i-lux,art-lojban,jbo,en_sl_IT,zh-Hant-CN-x-prv1-prv2
! 98:
! 99: lookup result:art-lojban
! 100: Canonical lookup result:art__lojban
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>