diff options
author | jim winstead <jimw@php.net> | 2002-01-04 19:48:08 +0000 |
---|---|---|
committer | jim winstead <jimw@php.net> | 2002-01-04 19:48:08 +0000 |
commit | f68b7c5f3ebdde46f4da5db40189bcd36caba033 (patch) | |
tree | 11698645044865e0b6fe44624fed23add8d5fc1c /ext/standard/tests | |
parent | 1808802279040ef9f87790ce93433d280079b00b (diff) | |
download | php-git-f68b7c5f3ebdde46f4da5db40189bcd36caba033.tar.gz |
Fixed segfault in wordwrap() when wrapping to zero width and using
multi-character break or trying to force cut (bug #12768, now fails
and issues a warning because forcing a zero-width cut doesn't make
sense). Also converted to new paramater-passing API and avoid making
an extra copy of the return values.
# also added tests.
@- Fixed segfault in wordwrap() when wrapping to zero width and using
@ multi-character break or trying to force cut (bug #12768). (Jim)
Diffstat (limited to 'ext/standard/tests')
-rw-r--r-- | ext/standard/tests/strings/wordwrap.phpt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/standard/tests/strings/wordwrap.phpt b/ext/standard/tests/strings/wordwrap.phpt new file mode 100644 index 0000000000..4e30fb41bb --- /dev/null +++ b/ext/standard/tests/strings/wordwrap.phpt @@ -0,0 +1,19 @@ +--TEST-- +wordwrap() function +--POST-- +--GET-- +--FILE-- +<?php + +$tests = <<<TESTS +"12345 12345 12345 12345" === wordwrap("12345 12345 12345 12345") +"12345 12345\\n1234567890\\n1234567890" === wordwrap("12345 12345 1234567890 1234567890",12) +"12345\\n12345\\n12345\\n12345" === wordwrap("12345 12345 12345 12345",0) +"12345ab12345ab12345ab12345" === wordwrap("12345 12345 12345 12345",0,"ab") +"12345 12345ab1234567890ab1234567890" === wordwrap("12345 12345 1234567890 1234567890",12,"ab") +TESTS; + +include('../../../../tests/quicktester.inc'); + +--EXPECT-- +OK |