File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -149,4 +149,26 @@ function test_list_pluck() {
149149 $ out = unfc_list_pluck ( $ list , 'id ' );
150150 $ this ->assertSame ( array ( 0 => 1 , 1 => 2 , 3 => 4 ), $ out );
151151 }
152+
153+ /**
154+ * @ticket unfc_utf8_ranges
155+ */
156+ function test_utf8_ranges () {
157+ $ arr = array (
158+ /**/
159+ array ( 0 , 0xa , '[\x00-\x0a] ' ),
160+ array ( 0x80 , 0x85 , '\xc2[\x80-\x85] ' ),
161+ array ( 0x800 , 0x850 , '\xe0(?:\xa0[\x80-\xbf]|\xa1[\x80-\x90]) ' ),
162+ array ( 0x10000 , 0x10040 , '\xf0\x90(?:\x80[\x80-\xbf]|\x81\x80) ' ),
163+ /**/
164+ );
165+
166+ foreach ( $ arr as $ item ) {
167+ list ( $ c1 , $ c2 , $ expected ) = $ item ;
168+ $ ranges = array ();
169+ unfc_utf8_ranges ( $ ranges , $ c1 , $ c2 );
170+ $ actual = unfc_utf8_regex_alts ( $ ranges );
171+ $ this ->assertSame ( $ expected , $ actual );
172+ }
173+ }
152174}
You can’t perform that action at this time.
0 commit comments