summaryrefslogtreecommitdiff
path: root/ext/mbstring/tests/mb_split.phpt
diff options
context:
space:
mode:
authorMoriyoshi Koizumi <moriyoshi@php.net>2002-10-21 19:19:05 +0000
committerMoriyoshi Koizumi <moriyoshi@php.net>2002-10-21 19:19:05 +0000
commitbce3d0cf7d7ae42bb9da887e8a946b92e6266702 (patch)
tree137fdcfa1c1a58929b8aa5803ff3481722fdeab7 /ext/mbstring/tests/mb_split.phpt
parent07b90cafc937462173c7ccc4a809349ec1f89940 (diff)
downloadphp-git-bce3d0cf7d7ae42bb9da887e8a946b92e6266702.tar.gz
Renamed the test cases.
Diffstat (limited to 'ext/mbstring/tests/mb_split.phpt')
-rw-r--r--ext/mbstring/tests/mb_split.phpt46
1 files changed, 46 insertions, 0 deletions
diff --git a/ext/mbstring/tests/mb_split.phpt b/ext/mbstring/tests/mb_split.phpt
new file mode 100644
index 0000000000..4ffcdeb109
--- /dev/null
+++ b/ext/mbstring/tests/mb_split.phpt
@@ -0,0 +1,46 @@
+--TEST--
+mb_split()
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+function_exists('mb_split') or die("SKIP");
+--POST--
+--GET--
+--FILE--
+<?php
+ mb_regex_set_options( '' );
+ mb_regex_encoding( 'EUC-JP' );
+
+ function verify_split( $spliton, $str, $count = 0 )
+ {
+ $result1 = mb_split( $spliton, $str, $count );
+ $result2 = split( $spliton, $str, $count );
+ if ( $result1 == $result2 ) {
+ print "ok\n";
+ } else {
+ print count($result1).'-'.count($result2)."\n";
+ }
+ }
+
+ var_dump( mb_split( " ", "a b c d e f g" )
+ == mb_split( "[[:space:]]", "a\nb\tc\nd e f g" ) );
+
+ for ( $i = 0; $i < 5; ++$i ) {
+ verify_split( " ", "a\tb\tc\td e\tf g", $i );
+ }
+
+ for ( $i = 1; $i < 5; ++$i ) {
+ verify_split( "\xa1\xa1+", "\xa1\xa1\xa1\xa2\xa2\xa1\xa1\xa1\xa1\xa1\xa1\xa2\xa2\xa1\xa1\xa1", $i );
+ }
+?>
+
+--EXPECT--
+bool(true)
+ok
+ok
+ok
+ok
+ok
+ok
+2-2
+3-3
+4-4