summaryrefslogtreecommitdiff
path: root/ext/pcre/tests/backtrack_limit.phpt
diff options
context:
space:
mode:
authorNuno Lopes <nlopess@php.net>2006-06-13 21:55:38 +0000
committerNuno Lopes <nlopess@php.net>2006-06-13 21:55:38 +0000
commitc93dc5d873981377b99c33019bda5b2319604e5e (patch)
tree5c9dbf72e057a7e6613a22314d2c98b1dd2e4691 /ext/pcre/tests/backtrack_limit.phpt
parent9660548a22c998b5110867cef20c7aa2a9d25f3b (diff)
downloadphp-git-c93dc5d873981377b99c33019bda5b2319604e5e.tar.gz
add new tests, increasing coverage by about 10%
Diffstat (limited to 'ext/pcre/tests/backtrack_limit.phpt')
-rw-r--r--ext/pcre/tests/backtrack_limit.phpt19
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/pcre/tests/backtrack_limit.phpt b/ext/pcre/tests/backtrack_limit.phpt
new file mode 100644
index 0000000000..ebfd720c3c
--- /dev/null
+++ b/ext/pcre/tests/backtrack_limit.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Backtracking limit
+--INI--
+pcre.backtrack_limit=2
+--FILE--
+<?php
+
+var_dump(preg_match_all('/.*\p{N}/', '0123456789', $dummy));
+var_dump(preg_last_error() === PREG_BACKTRACK_LIMIT_ERROR);
+
+var_dump(preg_match_all('/\p{Nd}/', '0123456789', $dummy));
+var_dump(preg_last_error() === PREG_NO_ERROR);
+
+?>
+--EXPECT--
+int(0)
+bool(true)
+int(10)
+bool(true)