diff options
author | Christian Schneider | 2020-12-03 16:08:31 +0100 |
---|---|---|
committer | Christian Schneider | 2020-12-03 16:08:31 +0100 |
commit | c997c6082ec2e47244ace87781d29c4766938197 (patch) | |
tree | 8305f31017373f6b8b74ff4dd62715618fb1f64d /test | |
parent | a7f4311e91040e6510df5b559b6daa008497ab10 (diff) | |
download | itools-c997c6082ec2e47244ace87781d29c4766938197.tar.gz itools-c997c6082ec2e47244ace87781d29c4766938197.tar.bz2 itools-c997c6082ec2e47244ace87781d29c4766938197.zip |
Add some tests for it::substr() behaviour we rely on which was broken for some PHP 8 Beta versions
Diffstat (limited to 'test')
-rwxr-xr-x | test/it.t | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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"); |