Annotation of embedaddon/php/ext/intl/tests/regression_sortwsk_eq.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Regression: sort_wsk() eq but different len.
        !             3: --SKIPIF--
        !             4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
        !             5: --FILE--
        !             6: <?php
        !             7: /*
        !             8:  * Test sorting strings that have different length but otherwise equal.
        !             9:  */
        !            10: 
        !            11: function sort_using_locale( $locale, $test_array )
        !            12: {
        !            13:     $coll = ut_coll_create( $locale );
        !            14: 
        !            15:     // Sort array.
        !            16:     ut_coll_sort_with_sort_keys( $coll, $test_array );
        !            17: 
        !            18:     // And return the sorted array.
        !            19:     return dump( $test_array ) . "\n";
        !            20: }
        !            21: 
        !            22: function ut_main()
        !            23: {
        !            24:     $res_str = '';
        !            25: 
        !            26:     // Define a couple of arrays.
        !            27:     // Each array contains equal strings that differ only in their length.
        !            28:     $a1 = array( 'aa', 'aaa', 'a' );
        !            29:     $a2 = array( 'пп', 'ппп', 'п' );
        !            30: 
        !            31:     // Sort them.
        !            32:     $res_str .= sort_using_locale( 'en_US', $a1 );
        !            33:     $res_str .= sort_using_locale( 'ru_RU', $a2 );
        !            34: 
        !            35:     return $res_str;
        !            36: }
        !            37: 
        !            38: require_once( 'ut_common.inc' );
        !            39: ut_run();
        !            40: ?>
        !            41: --EXPECT--
        !            42: array (
        !            43:   0 => 'a',
        !            44:   1 => 'aa',
        !            45:   2 => 'aaa',
        !            46: )
        !            47: array (
        !            48:   0 => 'п',
        !            49:   1 => 'пп',
        !            50:   2 => 'ппп',
        !            51: )

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>