From 0d0a7a432aff15332c1e003e2db8685dcf00ccee Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Sat, 8 Mar 2008 11:50:20 +0000 Subject: [PATCH] add new tests --- ext/pcre/tests/007.phpt | 59 +++++++++++++++++++++++++ ext/pcre/tests/invalid_utf8_offset.phpt | 35 +++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 ext/pcre/tests/007.phpt create mode 100644 ext/pcre/tests/invalid_utf8_offset.phpt diff --git a/ext/pcre/tests/007.phpt b/ext/pcre/tests/007.phpt new file mode 100644 index 0000000000..776bec27b2 --- /dev/null +++ b/ext/pcre/tests/007.phpt @@ -0,0 +1,59 @@ +--TEST-- +preg_replace_callback() with callback that modifies subject string +--SKIPIF-- + +--FILE-- + +--EXPECT-- +array(1) { + [0]=> + string(1) "o" +} +array(1) { + [0]=> + string(1) "l" +} +array(1) { + [0]=> + string(1) "a" +} +array(1) { + [0]=> + string(1) "1" +} +array(1) { + [0]=> + string(1) "2" +} +array(1) { + [0]=> + string(1) "3" +} +string(6) "ola123" +string(6) "olaÿ23" +bool(true) +NULL +bool(true) +Done! diff --git a/ext/pcre/tests/invalid_utf8_offset.phpt b/ext/pcre/tests/invalid_utf8_offset.phpt new file mode 100644 index 0000000000..4e0d40caf4 --- /dev/null +++ b/ext/pcre/tests/invalid_utf8_offset.phpt @@ -0,0 +1,35 @@ +--TEST-- +preg_replace() and invalid UTF8 offset +--SKIPIF-- + +--FILE-- + +--EXPECT-- +int(0) +array(0) { +} +bool(true) +int(1) +array(1) { + [0]=> + string(28) " uma string utf8 bem formada" +} +bool(true) +Done -- 2.40.0