nlopess         Wed Jun 14 18:07:46 2006 UTC

  Modified files:              
    /php-src/ext/pcre/tests     dollar_endonly.phpt match_flags.phpt 
                                match_flags2.phpt pcre_anchored.phpt 
                                pcre_extended.phpt pcre_extra.phpt 
                                ungreedy.phpt delimiters.phpt locales.phpt 
  Log:
  MFB
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/pcre/tests/dollar_endonly.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/pcre/tests/dollar_endonly.phpt
diff -u /dev/null php-src/ext/pcre/tests/dollar_endonly.phpt:1.2
--- /dev/null   Wed Jun 14 18:07:46 2006
+++ php-src/ext/pcre/tests/dollar_endonly.phpt  Wed Jun 14 18:07:45 2006
@@ -0,0 +1,39 @@
+--TEST--
+D (PCRE_DOLLAR_ENDONLY) modififer
+--FILE--
+<?php
+
+var_dump(preg_match_all('/^\S+.+$/', "aeiou\n", $m));
+var_dump($m);
+
+var_dump(preg_match_all('/^\S+.+$/D', "aeiou\n", $m));
+var_dump($m);
+
+var_dump(preg_match_all('/^\S+\s$/D', "aeiou\n", $m));
+var_dump($m);
+
+?>
+--EXPECT--
+int(1)
+array(1) {
+  [0]=>
+  array(1) {
+    [0]=>
+    string(5) "aeiou"
+  }
+}
+int(0)
+array(1) {
+  [0]=>
+  array(0) {
+  }
+}
+int(1)
+array(1) {
+  [0]=>
+  array(1) {
+    [0]=>
+    string(6) "aeiou
+"
+  }
+}
http://cvs.php.net/viewcvs.cgi/php-src/ext/pcre/tests/match_flags.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/pcre/tests/match_flags.phpt
diff -u /dev/null php-src/ext/pcre/tests/match_flags.phpt:1.2
--- /dev/null   Wed Jun 14 18:07:46 2006
+++ php-src/ext/pcre/tests/match_flags.phpt     Wed Jun 14 18:07:45 2006
@@ -0,0 +1,127 @@
+--TEST--
+preg_match_all() flags
+--FILE--
+<?php
+
+var_dump(preg_match_all('/(.)x/', 'zxax', $match, PREG_PATTERN_ORDER));
+var_dump($match);
+
+var_dump(preg_match_all('/(.)x/', 'zxyx', $match, PREG_SET_ORDER));
+var_dump($match);
+
+var_dump(preg_match_all('/(.)x/', 'zxyx', $match, PREG_OFFSET_CAPTURE));
+var_dump($match);
+
+var_dump(preg_match_all('/(.)x/', 'zxyx', $match, PREG_SET_ORDER | 
PREG_OFFSET_CAPTURE));
+var_dump($match);
+
+?>
+--EXPECT--
+int(2)
+array(2) {
+  [0]=>
+  array(2) {
+    [0]=>
+    string(2) "zx"
+    [1]=>
+    string(2) "ax"
+  }
+  [1]=>
+  array(2) {
+    [0]=>
+    string(1) "z"
+    [1]=>
+    string(1) "a"
+  }
+}
+int(2)
+array(2) {
+  [0]=>
+  array(2) {
+    [0]=>
+    string(2) "zx"
+    [1]=>
+    string(1) "z"
+  }
+  [1]=>
+  array(2) {
+    [0]=>
+    string(2) "yx"
+    [1]=>
+    string(1) "y"
+  }
+}
+int(2)
+array(2) {
+  [0]=>
+  array(2) {
+    [0]=>
+    array(2) {
+      [0]=>
+      string(2) "zx"
+      [1]=>
+      int(0)
+    }
+    [1]=>
+    array(2) {
+      [0]=>
+      string(2) "yx"
+      [1]=>
+      int(2)
+    }
+  }
+  [1]=>
+  array(2) {
+    [0]=>
+    array(2) {
+      [0]=>
+      string(1) "z"
+      [1]=>
+      int(0)
+    }
+    [1]=>
+    array(2) {
+      [0]=>
+      string(1) "y"
+      [1]=>
+      int(2)
+    }
+  }
+}
+int(2)
+array(2) {
+  [0]=>
+  array(2) {
+    [0]=>
+    array(2) {
+      [0]=>
+      string(2) "zx"
+      [1]=>
+      int(0)
+    }
+    [1]=>
+    array(2) {
+      [0]=>
+      string(1) "z"
+      [1]=>
+      int(0)
+    }
+  }
+  [1]=>
+  array(2) {
+    [0]=>
+    array(2) {
+      [0]=>
+      string(2) "yx"
+      [1]=>
+      int(2)
+    }
+    [1]=>
+    array(2) {
+      [0]=>
+      string(1) "y"
+      [1]=>
+      int(2)
+    }
+  }
+}
http://cvs.php.net/viewcvs.cgi/php-src/ext/pcre/tests/match_flags2.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/pcre/tests/match_flags2.phpt
diff -u /dev/null php-src/ext/pcre/tests/match_flags2.phpt:1.2
--- /dev/null   Wed Jun 14 18:07:46 2006
+++ php-src/ext/pcre/tests/match_flags2.phpt    Wed Jun 14 18:07:45 2006
@@ -0,0 +1,175 @@
+--TEST--
+preg_match() flags
+--FILE--
+<?php
+
+var_dump(preg_match('/x(.)/', 'fjszxax', $match, PREG_OFFSET_CAPTURE));
+var_dump($match);
+
+var_dump(preg_match('/(.)x/', 'fjszxax', $match, PREG_OFFSET_CAPTURE, 4));
+var_dump($match);
+
+var_dump(preg_match('/(?P<capt1>.)(x)(?P<letsmix>\S+)/', 'fjszxax', $match, 
PREG_OFFSET_CAPTURE));
+var_dump($match);
+
+?>
+--EXPECT--
+int(1)
+array(2) {
+  [0]=>
+  array(2) {
+    [0]=>
+    string(2) "xa"
+    [1]=>
+    int(4)
+  }
+  [1]=>
+  array(2) {
+    [0]=>
+    string(1) "a"
+    [1]=>
+    int(5)
+  }
+}
+int(1)
+array(2) {
+  [0]=>
+  array(2) {
+    [0]=>
+    string(2) "ax"
+    [1]=>
+    int(5)
+  }
+  [1]=>
+  array(2) {
+    [0]=>
+    string(1) "a"
+    [1]=>
+    int(5)
+  }
+}
+int(1)
+array(6) {
+  [0]=>
+  array(2) {
+    [0]=>
+    string(4) "zxax"
+    [1]=>
+    int(3)
+  }
+  ["capt1"]=>
+  array(2) {
+    [0]=>
+    string(1) "z"
+    [1]=>
+    int(3)
+  }
+  [1]=>
+  array(2) {
+    [0]=>
+    string(1) "z"
+    [1]=>
+    int(3)
+  }
+  [2]=>
+  array(2) {
+    [0]=>
+    string(1) "x"
+    [1]=>
+    int(4)
+  }
+  ["letsmix"]=>
+  array(2) {
+    [0]=>
+    string(2) "ax"
+    [1]=>
+    int(5)
+  }
+  [3]=>
+  array(2) {
+    [0]=>
+    string(2) "ax"
+    [1]=>
+    int(5)
+  }
+}
+--UEXPECT--
+int(1)
+array(2) {
+  [0]=>
+  array(2) {
+    [0]=>
+    string(2) "xa"
+    [1]=>
+    int(4)
+  }
+  [1]=>
+  array(2) {
+    [0]=>
+    string(1) "a"
+    [1]=>
+    int(5)
+  }
+}
+int(1)
+array(2) {
+  [0]=>
+  array(2) {
+    [0]=>
+    string(2) "ax"
+    [1]=>
+    int(5)
+  }
+  [1]=>
+  array(2) {
+    [0]=>
+    string(1) "a"
+    [1]=>
+    int(5)
+  }
+}
+int(1)
+array(6) {
+  [0]=>
+  array(2) {
+    [0]=>
+    string(4) "zxax"
+    [1]=>
+    int(3)
+  }
+  [u"capt1"]=>
+  array(2) {
+    [0]=>
+    string(1) "z"
+    [1]=>
+    int(3)
+  }
+  [1]=>
+  array(2) {
+    [0]=>
+    string(1) "z"
+    [1]=>
+    int(3)
+  }
+  [2]=>
+  array(2) {
+    [0]=>
+    string(1) "x"
+    [1]=>
+    int(4)
+  }
+  [u"letsmix"]=>
+  array(2) {
+    [0]=>
+    string(2) "ax"
+    [1]=>
+    int(5)
+  }
+  [3]=>
+  array(2) {
+    [0]=>
+    string(2) "ax"
+    [1]=>
+    int(5)
+  }
+}
http://cvs.php.net/viewcvs.cgi/php-src/ext/pcre/tests/pcre_anchored.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/pcre/tests/pcre_anchored.phpt
diff -u /dev/null php-src/ext/pcre/tests/pcre_anchored.phpt:1.2
--- /dev/null   Wed Jun 14 18:07:46 2006
+++ php-src/ext/pcre/tests/pcre_anchored.phpt   Wed Jun 14 18:07:45 2006
@@ -0,0 +1,22 @@
+--TEST--
+A (PCRE_ANCHORED) modififer
+--FILE--
+<?php
+
+var_dump(preg_match('/\PN+/', '123abc', $m));
+var_dump($m);
+
+var_dump(preg_match('/\P{N}+/A', '123abc'));
+var_dump(preg_match('/^\P{N}+/', '123abc'));
+var_dump(preg_match('/^\P{N}+/A', '123abc'));
+
+?>
+--EXPECT--
+int(1)
+array(1) {
+  [0]=>
+  string(3) "abc"
+}
+int(0)
+int(0)
+int(0)
http://cvs.php.net/viewcvs.cgi/php-src/ext/pcre/tests/pcre_extended.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/pcre/tests/pcre_extended.phpt
diff -u /dev/null php-src/ext/pcre/tests/pcre_extended.phpt:1.2
--- /dev/null   Wed Jun 14 18:07:46 2006
+++ php-src/ext/pcre/tests/pcre_extended.phpt   Wed Jun 14 18:07:45 2006
@@ -0,0 +1,29 @@
+--TEST--
+x (PCRE_EXTENDED) modififer
+--FILE--
+<?php
+
+var_dump(preg_match('/a e i o u/', 'aeiou', $m));
+var_dump($m);
+
+var_dump(preg_match('/a e i o u/x', 'aeiou', $m));
+var_dump($m);
+
+var_dump(preg_match("/a e\ni\to\ru/x", 'aeiou', $m));
+var_dump($m);
+
+?>
+--EXPECT--
+int(0)
+array(0) {
+}
+int(1)
+array(1) {
+  [0]=>
+  string(5) "aeiou"
+}
+int(1)
+array(1) {
+  [0]=>
+  string(5) "aeiou"
+}
http://cvs.php.net/viewcvs.cgi/php-src/ext/pcre/tests/pcre_extra.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/pcre/tests/pcre_extra.phpt
diff -u /dev/null php-src/ext/pcre/tests/pcre_extra.phpt:1.2
--- /dev/null   Wed Jun 14 18:07:46 2006
+++ php-src/ext/pcre/tests/pcre_extra.phpt      Wed Jun 14 18:07:45 2006
@@ -0,0 +1,14 @@
+--TEST--
+X (PCRE_EXTRA) modififer
+--FILE--
+<?php
+
+var_dump(preg_match('/\y/', '\y'));
+var_dump(preg_match('/\y/X', '\y'));
+
+?>
+--EXPECTF--
+int(1)
+
+Warning: preg_match(): Compilation failed: unrecognized character follows \ at 
offset 1 in %spcre_extra.php on line 4
+bool(false)
http://cvs.php.net/viewcvs.cgi/php-src/ext/pcre/tests/ungreedy.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/pcre/tests/ungreedy.phpt
diff -u /dev/null php-src/ext/pcre/tests/ungreedy.phpt:1.2
--- /dev/null   Wed Jun 14 18:07:46 2006
+++ php-src/ext/pcre/tests/ungreedy.phpt        Wed Jun 14 18:07:45 2006
@@ -0,0 +1,31 @@
+--TEST--
+U (PCRE_UNGREEDY) modififer
+--FILE--
+<?php
+
+var_dump(preg_match('/<.*>/', '<aa> <bb> <cc>', $m));
+var_dump($m);
+
+var_dump(preg_match('/<.*>/U', '<aa> <bb> <cc>', $m));
+var_dump($m);
+
+var_dump(preg_match('/(?U)<.*>/', '<aa> <bb> <cc>', $m));
+var_dump($m);
+
+?>
+--EXPECT--
+int(1)
+array(1) {
+  [0]=>
+  string(14) "<aa> <bb> <cc>"
+}
+int(1)
+array(1) {
+  [0]=>
+  string(4) "<aa>"
+}
+int(1)
+array(1) {
+  [0]=>
+  string(4) "<aa>"
+}
http://cvs.php.net/viewcvs.cgi/php-src/ext/pcre/tests/delimiters.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/pcre/tests/delimiters.phpt
diff -u php-src/ext/pcre/tests/delimiters.phpt:1.2 
php-src/ext/pcre/tests/delimiters.phpt:1.3
--- php-src/ext/pcre/tests/delimiters.phpt:1.2  Tue Jun 13 22:05:26 2006
+++ php-src/ext/pcre/tests/delimiters.phpt      Wed Jun 14 18:07:45 2006
@@ -11,6 +11,7 @@
 var_dump(preg_match('~a', ''));
 var_dump(preg_match('@[EMAIL PROTECTED]@@', '@@'));
 var_dump(preg_match('//z', '@@'));
+var_dump(preg_match('{', ''));
 
 ?>
 --EXPECTF--
@@ -31,3 +32,6 @@
 
 Warning: preg_match(): Unknown modifier 'z' in %sdelimiters.php on line 10
 bool(false)
+
+Warning: preg_match(): No ending matching delimiter '}' found in 
%sdelimiters.php on line 11
+bool(false)
http://cvs.php.net/viewcvs.cgi/php-src/ext/pcre/tests/locales.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/pcre/tests/locales.phpt
diff -u php-src/ext/pcre/tests/locales.phpt:1.2 
php-src/ext/pcre/tests/locales.phpt:1.3
--- php-src/ext/pcre/tests/locales.phpt:1.2     Tue Jun 13 22:05:26 2006
+++ php-src/ext/pcre/tests/locales.phpt Wed Jun 14 18:07:45 2006
@@ -1,10 +1,12 @@
 --TEST--
 Localized match
 --SKIPIF--
-<?php if (!function_exists('setlocale')) die('setlocale() not available'); ?>
+<?php if (!function_exists('setlocale')) die('skip: setlocale() not 
available'); ?>
 --FILE--
 <?php
 
+declare(encoding=latin1);
+
 // this tests if the cache is working correctly, as the char tables
 // must be rebuilt after the locale change
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to