From c997c6082ec2e47244ace87781d29c4766938197 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Thu, 3 Dec 2020 16:08:31 +0100 Subject: Add some tests for it::substr() behaviour we rely on which was broken for some PHP 8 Beta versions --- test/it.t | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/it.t b/test/it.t index 49d5854..a3abf32 100755 --- a/test/it.t +++ b/test/it.t @@ -381,6 +381,10 @@ is(it::ucwords('foo bär über'), 'Foo Bär Über'); # it::substr_replace is(it::substr_replace('abcdefgh', 'xyz', 2, 4), substr_replace('abcdefgh', 'xyz', 2, 4), 'it::substr_replace the same as substr_replace for ascii'); is(it::substr_replace('✔☯♥', '☃☃', 1, 1), '✔☃☃♥', 'it::substr_replace for utf-8'); +is(it::substr_replace('', 'xyz', 0, 0), substr_replace('', 'xyz', 0, 0), 'it::substr_replace with empty haystack the same as substr_replace'); +is(it::substr_replace('abc', 'xyz', 0, 2), substr_replace('abc', 'xyz', 0, 2), 'it::substr_replace replacing to end of haystack'); +is(it::substr_replace('abc', 'xyz', 0, 10), substr_replace('abc', 'xyz', 0, 10), 'it::substr_replace replacing past end of haystack'); +is(it::substr_replace('abcdefgh', 'xyz', 10, 4), substr_replace('abcdefgh', 'xyz', 10, 4), 'it::substr_replace outside of string'); is(grapheme_strlen("\xc1"), null, "need grapheme_strlen side effect for any2utf8"); -- cgit v1.2.3