From fa61cf8a316265af15cb937d15ef0fbd9f49e818 Mon Sep 17 00:00:00 2001 From: Raghubansh Kumar Date: Sat, 29 Sep 2007 12:57:06 +0000 Subject: [PATCH] New testcases for chunk_split() function --- .../tests/strings/chunk_split_basic.phpt | 67 +++++ .../tests/strings/chunk_split_error.phpt | 49 ++++ .../tests/strings/chunk_split_variation1.phpt | 241 +++++++++++++++ .../strings/chunk_split_variation10.phpt | 119 ++++++++ .../strings/chunk_split_variation11.phpt | 145 +++++++++ .../strings/chunk_split_variation12.phpt | 206 +++++++++++++ .../strings/chunk_split_variation13.phpt | 55 ++++ .../tests/strings/chunk_split_variation2.phpt | 274 ++++++++++++++++++ .../tests/strings/chunk_split_variation3.phpt | 228 +++++++++++++++ .../tests/strings/chunk_split_variation4.phpt | 268 +++++++++++++++++ .../tests/strings/chunk_split_variation5.phpt | Bin 0 -> 3266 bytes .../tests/strings/chunk_split_variation6.phpt | 105 +++++++ .../tests/strings/chunk_split_variation7.phpt | Bin 0 -> 3446 bytes .../tests/strings/chunk_split_variation8.phpt | 128 ++++++++ .../tests/strings/chunk_split_variation9.phpt | Bin 0 -> 5440 bytes 15 files changed, 1885 insertions(+) create mode 100644 ext/standard/tests/strings/chunk_split_basic.phpt create mode 100644 ext/standard/tests/strings/chunk_split_error.phpt create mode 100644 ext/standard/tests/strings/chunk_split_variation1.phpt create mode 100644 ext/standard/tests/strings/chunk_split_variation10.phpt create mode 100644 ext/standard/tests/strings/chunk_split_variation11.phpt create mode 100644 ext/standard/tests/strings/chunk_split_variation12.phpt create mode 100644 ext/standard/tests/strings/chunk_split_variation13.phpt create mode 100644 ext/standard/tests/strings/chunk_split_variation2.phpt create mode 100644 ext/standard/tests/strings/chunk_split_variation3.phpt create mode 100644 ext/standard/tests/strings/chunk_split_variation4.phpt create mode 100644 ext/standard/tests/strings/chunk_split_variation5.phpt create mode 100644 ext/standard/tests/strings/chunk_split_variation6.phpt create mode 100644 ext/standard/tests/strings/chunk_split_variation7.phpt create mode 100644 ext/standard/tests/strings/chunk_split_variation8.phpt create mode 100644 ext/standard/tests/strings/chunk_split_variation9.phpt diff --git a/ext/standard/tests/strings/chunk_split_basic.phpt b/ext/standard/tests/strings/chunk_split_basic.phpt new file mode 100644 index 0000000000..e5cf2fad72 --- /dev/null +++ b/ext/standard/tests/strings/chunk_split_basic.phpt @@ -0,0 +1,67 @@ +--TEST-- +Test chunk_split() function : basic functionality +--FILE-- + +--EXPECTF-- +*** Testing chunk_split() : basic functionality *** +-- Testing chunk_split() with all possible arguments -- +string(15) "Te##st##in##g##" +-- Testing chunk_split() with default ending string -- +string(15) "Te +st +in +g +" +-- Testing chunk_split() with default chunklen and ending string -- +string(9) "Testing +" +Done + +--UEXPECTF-- +*** Testing chunk_split() : basic functionality *** +-- Testing chunk_split() with all possible arguments -- +unicode(15) "Te##st##in##g##" +-- Testing chunk_split() with default ending string -- +unicode(15) "Te +st +in +g +" +-- Testing chunk_split() with default chunklen and ending string -- +unicode(9) "Testing +" +Done diff --git a/ext/standard/tests/strings/chunk_split_error.phpt b/ext/standard/tests/strings/chunk_split_error.phpt new file mode 100644 index 0000000000..9a0819c732 --- /dev/null +++ b/ext/standard/tests/strings/chunk_split_error.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test chunk_split() function : error conditions +--FILE-- + +--EXPECTF-- +*** Testing chunk_split() : error conditions *** +-- Testing chunk_split() function with Zero arguments -- +Warning: chunk_split() expects at least 1 parameter, 0 given in %s on line %d +NULL +-- Testing chunk_split() function with more than expected no. of arguments -- +Warning: chunk_split() expects at most 3 parameters, 4 given in %s on line %d +NULL +Done +--UEXPECTF-- +*** Testing chunk_split() : error conditions *** +-- Testing chunk_split() function with Zero arguments -- +Warning: chunk_split() expects at least 1 parameter, 0 given in %s on line %d +NULL +-- Testing chunk_split() function with more than expected no. of arguments -- +Warning: chunk_split() expects at most 3 parameters, 4 given in %s on line %d +NULL +Done diff --git a/ext/standard/tests/strings/chunk_split_variation1.phpt b/ext/standard/tests/strings/chunk_split_variation1.phpt new file mode 100644 index 0000000000..95d3720a78 --- /dev/null +++ b/ext/standard/tests/strings/chunk_split_variation1.phpt @@ -0,0 +1,241 @@ +--TEST-- +Test chunk_split() function : usage variations - with unexpected values for 'str' argument +--FILE-- + 'red', 'item' => 'pen'), + + // null data + NULL, + null, + + // boolean data + true, + false, + TRUE, + FALSE, + + // empty data + "", + '', + + // string data + "string", + 'string', + + // object data + new MyClass(), + + // undefined data + @$undefined_var, + + // unset data + @$unset_var, + + // resource data + $fp +); + +// loop through each element of the array for str +for($count = 0; $count < count($values); $count++) { + echo "-- Iteration ".($count+1)." --\n"; + var_dump( chunk_split($values[$count], $chunklen, $ending) ); +}; + +echo "Done"; + +// close the resource +fclose($fp); + +?> +--EXPECTF-- +*** Testing chunk_split() : with unexpected values for 'str' argument *** +-- Iteration 1 -- +string(2) "0 " +-- Iteration 2 -- +string(2) "1 " +-- Iteration 3 -- +string(8) "12 34 5 " +-- Iteration 4 -- +string(8) "-2 34 5 " +-- Iteration 5 -- +string(6) "10 .5 " +-- Iteration 6 -- +string(8) "-1 0. 5 " +-- Iteration 7 -- +string(18) "10 50 00 00 00 00 " +-- Iteration 8 -- +string(11) "1. 06 E- 9 " +-- Iteration 9 -- +string(5) "0. 5 " +-- Iteration 10 -- + +Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d%d +NULL +-- Iteration 11 -- + +Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d%d +NULL +-- Iteration 12 -- + +Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d%d +NULL +-- Iteration 13 -- + +Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d%d +NULL +-- Iteration 14 -- + +Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d%d +NULL +-- Iteration 15 -- +string(1) " " +-- Iteration 16 -- +string(1) " " +-- Iteration 17 -- +string(2) "1 " +-- Iteration 18 -- +string(1) " " +-- Iteration 19 -- +string(2) "1 " +-- Iteration 20 -- +string(1) " " +-- Iteration 21 -- +string(1) " " +-- Iteration 22 -- +string(1) " " +-- Iteration 23 -- +string(9) "st ri ng " +-- Iteration 24 -- +string(9) "st ri ng " +-- Iteration 25 -- +string(9) "ob je ct " +-- Iteration 26 -- +string(1) " " +-- Iteration 27 -- +string(1) " " +-- Iteration 28 -- + +Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d%d +NULL +Done + +--UEXPECTF-- +*** Testing chunk_split() : with unexpected values for 'str' argument *** +-- Iteration 1 -- +unicode(2) "0 " +-- Iteration 2 -- +unicode(2) "1 " +-- Iteration 3 -- +unicode(8) "12 34 5 " +-- Iteration 4 -- +unicode(8) "-2 34 5 " +-- Iteration 5 -- +unicode(6) "10 .5 " +-- Iteration 6 -- +unicode(8) "-1 0. 5 " +-- Iteration 7 -- +unicode(18) "10 50 00 00 00 00 " +-- Iteration 8 -- +unicode(11) "1. 06 E- 9 " +-- Iteration 9 -- +unicode(5) "0. 5 " +-- Iteration 10 -- + +Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 12 -- + +Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 13 -- + +Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 14 -- + +Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 15 -- +unicode(1) " " +-- Iteration 16 -- +unicode(1) " " +-- Iteration 17 -- +unicode(2) "1 " +-- Iteration 18 -- +unicode(1) " " +-- Iteration 19 -- +unicode(2) "1 " +-- Iteration 20 -- +unicode(1) " " +-- Iteration 21 -- +unicode(1) " " +-- Iteration 22 -- +unicode(1) " " +-- Iteration 23 -- +unicode(9) "st ri ng " +-- Iteration 24 -- +unicode(9) "st ri ng " +-- Iteration 25 -- +unicode(9) "ob je ct " +-- Iteration 26 -- +unicode(1) " " +-- Iteration 27 -- +unicode(1) " " +-- Iteration 28 -- + +Warning: chunk_split() expects parameter 1 to be string (Unicode or binary), resource given in %s on line %d +NULL +Done diff --git a/ext/standard/tests/strings/chunk_split_variation10.phpt b/ext/standard/tests/strings/chunk_split_variation10.phpt new file mode 100644 index 0000000000..805bba5ae9 --- /dev/null +++ b/ext/standard/tests/strings/chunk_split_variation10.phpt @@ -0,0 +1,119 @@ +--TEST-- +Test chunk_split() function : usage variations - different single quoted strings for 'ending' argument +--FILE-- + +--EXPECTF-- +*** Testing chunk_split() : different single quoted strings as 'ending' *** +-- Iteration 0 -- +string(73) "This is to test chunk_split() with various 'single quoted' ending string." +-- Iteration 1 -- +string(82) "This is t o test ch unk_split () with v arious 's ingle quo ted' endi ng string . " +-- Iteration 2 -- +string(82) "This is tao test chaunk_splita() with vaarious 'saingle quoated' endiang stringa.a" +-- Iteration 3 -- +string(127) "This is tENDINGo test chENDINGunk_splitENDING() with vENDINGarious 'sENDINGingle quoENDINGted' endiENDINGng stringENDING.ENDING" +-- Iteration 4 -- +string(118) "This is t@#$%^o test ch@#$%^unk_split@#$%^() with v@#$%^arious 's@#$%^ingle quo@#$%^ted' endi@#$%^ng string@#$%^.@#$%^" +-- Iteration 5 -- +string(91) "This is t\to test ch\tunk_split\t() with v\tarious 's\tingle quo\tted' endi\tng string\t.\t" +-- Iteration 6 -- +string(91) "This is t\no test ch\nunk_split\n() with v\narious 's\ningle quo\nted' endi\nng string\n.\n" +-- Iteration 7 -- +string(91) "This is t\ro test ch\runk_split\r() with v\rarious 's\ringle quo\rted' endi\rng string\r.\r" +-- Iteration 8 -- +string(109) "This is t\r\no test ch\r\nunk_split\r\n() with v\r\narious 's\r\ningle quo\r\nted' endi\r\nng string\r\n.\r\n" +-- Iteration 9 -- +string(91) "This is t\0o test ch\0unk_split\0() with v\0arious 's\0ingle quo\0ted' endi\0ng string\0.\0" +-- Iteration 10 -- +string(100) "This is t123o test ch123unk_split123() with v123arious 's123ingle quo123ted' endi123ng string123.123" +-- Iteration 11 -- +string(118) "This is t(MSG)o test ch(MSG)unk_split(MSG)() with v(MSG)arious 's(MSG)ingle quo(MSG)ted' endi(MSG)ng string(MSG).(MSG)" +-- Iteration 12 -- +string(226) "This is t) ending string (o test ch) ending string (unk_split) ending string (() with v) ending string (arious 's) ending string (ingle quo) ending string (ted' endi) ending string (ng string) ending string (.) ending string (" +-- Iteration 13 -- +string(217) "This is t) numbers 1234 (o test ch) numbers 1234 (unk_split) numbers 1234 (() with v) numbers 1234 (arious 's) numbers 1234 (ingle quo) numbers 1234 (ted' endi) numbers 1234 (ng string) numbers 1234 (.) numbers 1234 (" +-- Iteration 14 -- +string(226) "This is t) speci@! ch@r$ (o test ch) speci@! ch@r$ (unk_split) speci@! ch@r$ (() with v) speci@! ch@r$ (arious 's) speci@! ch@r$ (ingle quo) speci@! ch@r$ (ted' endi) speci@! ch@r$ (ng string) speci@! ch@r$ (.) speci@! ch@r$ (" +Done + +--UEXPECTF-- +*** Testing chunk_split() : different single quoted strings as 'ending' *** +-- Iteration 0 -- +unicode(73) "This is to test chunk_split() with various 'single quoted' ending string." +-- Iteration 1 -- +unicode(82) "This is t o test ch unk_split () with v arious 's ingle quo ted' endi ng string . " +-- Iteration 2 -- +unicode(82) "This is tao test chaunk_splita() with vaarious 'saingle quoated' endiang stringa.a" +-- Iteration 3 -- +unicode(127) "This is tENDINGo test chENDINGunk_splitENDING() with vENDINGarious 'sENDINGingle quoENDINGted' endiENDINGng stringENDING.ENDING" +-- Iteration 4 -- +unicode(118) "This is t@#$%^o test ch@#$%^unk_split@#$%^() with v@#$%^arious 's@#$%^ingle quo@#$%^ted' endi@#$%^ng string@#$%^.@#$%^" +-- Iteration 5 -- +unicode(91) "This is t\to test ch\tunk_split\t() with v\tarious 's\tingle quo\tted' endi\tng string\t.\t" +-- Iteration 6 -- +unicode(91) "This is t\no test ch\nunk_split\n() with v\narious 's\ningle quo\nted' endi\nng string\n.\n" +-- Iteration 7 -- +unicode(91) "This is t\ro test ch\runk_split\r() with v\rarious 's\ringle quo\rted' endi\rng string\r.\r" +-- Iteration 8 -- +unicode(109) "This is t\r\no test ch\r\nunk_split\r\n() with v\r\narious 's\r\ningle quo\r\nted' endi\r\nng string\r\n.\r\n" +-- Iteration 9 -- +unicode(91) "This is t\0o test ch\0unk_split\0() with v\0arious 's\0ingle quo\0ted' endi\0ng string\0.\0" +-- Iteration 10 -- +unicode(100) "This is t123o test ch123unk_split123() with v123arious 's123ingle quo123ted' endi123ng string123.123" +-- Iteration 11 -- +unicode(118) "This is t(MSG)o test ch(MSG)unk_split(MSG)() with v(MSG)arious 's(MSG)ingle quo(MSG)ted' endi(MSG)ng string(MSG).(MSG)" +-- Iteration 12 -- +unicode(226) "This is t) ending string (o test ch) ending string (unk_split) ending string (() with v) ending string (arious 's) ending string (ingle quo) ending string (ted' endi) ending string (ng string) ending string (.) ending string (" +-- Iteration 13 -- +unicode(217) "This is t) numbers 1234 (o test ch) numbers 1234 (unk_split) numbers 1234 (() with v) numbers 1234 (arious 's) numbers 1234 (ingle quo) numbers 1234 (ted' endi) numbers 1234 (ng string) numbers 1234 (.) numbers 1234 (" +-- Iteration 14 -- +unicode(226) "This is t) speci@! ch@r$ (o test ch) speci@! ch@r$ (unk_split) speci@! ch@r$ (() with v) speci@! ch@r$ (arious 's) speci@! ch@r$ (ingle quo) speci@! ch@r$ (ted' endi) speci@! ch@r$ (ng string) speci@! ch@r$ (.) speci@! ch@r$ (" +Done \ No newline at end of file diff --git a/ext/standard/tests/strings/chunk_split_variation11.phpt b/ext/standard/tests/strings/chunk_split_variation11.phpt new file mode 100644 index 0000000000..4725461098 --- /dev/null +++ b/ext/standard/tests/strings/chunk_split_variation11.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test chunk_split() function : usage variations - different strings for 'ending' with heredoc 'str' +--FILE-- + +--EXPECTF-- +*** Testing chunk_split() : different values for 'ending' with heredoc 'str'*** +-- Iteration 1 -- +string(113) "This is heredoc string with and +.It also contains +sPeci@! ch@r$ :) & numbers 222.This is \k wrong escape char." +-- Iteration 2 -- +string(132) "This i s here doc st ring w ith and +. It als o cont ains +s Peci@! ch@r$ :) & number s 222. This i s \k w rong e scape char. " +-- Iteration 3 -- +string(132) "This ias hereadoc staring waith aand +.aIt alsao contaains +saPeci@!a ch@r$a :) & anumberas 222.aThis ias \k warong eascape achar.a" +-- Iteration 4 -- +string(227) "This iENDINGs hereENDINGdoc stENDINGring wENDINGith ENDINGand +.ENDINGIt alsENDINGo contENDINGains +sENDINGPeci@!ENDING ch@r$ENDING :) & ENDINGnumberENDINGs 222.ENDINGThis iENDINGs \k wENDINGrong eENDINGscape ENDINGchar.ENDING" +-- Iteration 5 -- +string(151) "This i +s here +doc st +ring w +ith +and +. +It als +o cont +ains +s +Peci@! + ch@r$ + :) & +number +s 222. +This i +s \k w +rong e +scape +char. +" +-- Iteration 6 -- +string(170) "This i123s here123doc st123ring w123ith 123and +.123It als123o cont123ains +s123Peci@!123 ch@r$123 :) & 123number123s 222.123This i123s \k w123rong e123scape 123char.123" +-- Iteration 7 -- +string(398) "This i)speci@! ch@r$(s here)speci@! ch@r$(doc st)speci@! ch@r$(ring w)speci@! ch@r$(ith )speci@! ch@r$(and +.)speci@! ch@r$(It als)speci@! ch@r$(o cont)speci@! ch@r$(ains +s)speci@! ch@r$(Peci@!)speci@! ch@r$( ch@r$)speci@! ch@r$( :) & )speci@! ch@r$(number)speci@! ch@r$(s 222.)speci@! ch@r$(This i)speci@! ch@r$(s \k w)speci@! ch@r$(rong e)speci@! ch@r$(scape )speci@! ch@r$(char.)speci@! ch@r$(" +Done + +--UEXPECTF-- +*** Testing chunk_split() : different values for 'ending' with heredoc 'str'*** +-- Iteration 1 -- +unicode(113) "This is heredoc string with and +.It also contains +sPeci@! ch@r$ :) & numbers 222.This is \k wrong escape char." +-- Iteration 2 -- +unicode(132) "This i s here doc st ring w ith and +. It als o cont ains +s Peci@! ch@r$ :) & number s 222. This i s \k w rong e scape char. " +-- Iteration 3 -- +unicode(132) "This ias hereadoc staring waith aand +.aIt alsao contaains +saPeci@!a ch@r$a :) & anumberas 222.aThis ias \k warong eascape achar.a" +-- Iteration 4 -- +unicode(227) "This iENDINGs hereENDINGdoc stENDINGring wENDINGith ENDINGand +.ENDINGIt alsENDINGo contENDINGains +sENDINGPeci@!ENDING ch@r$ENDING :) & ENDINGnumberENDINGs 222.ENDINGThis iENDINGs \k wENDINGrong eENDINGscape ENDINGchar.ENDING" +-- Iteration 5 -- +unicode(151) "This i +s here +doc st +ring w +ith +and +. +It als +o cont +ains +s +Peci@! + ch@r$ + :) & +number +s 222. +This i +s \k w +rong e +scape +char. +" +-- Iteration 6 -- +unicode(170) "This i123s here123doc st123ring w123ith 123and +.123It als123o cont123ains +s123Peci@!123 ch@r$123 :) & 123number123s 222.123This i123s \k w123rong e123scape 123char.123" +-- Iteration 7 -- +unicode(398) "This i)speci@! ch@r$(s here)speci@! ch@r$(doc st)speci@! ch@r$(ring w)speci@! ch@r$(ith )speci@! ch@r$(and +.)speci@! ch@r$(It als)speci@! ch@r$(o cont)speci@! ch@r$(ains +s)speci@! ch@r$(Peci@!)speci@! ch@r$( ch@r$)speci@! ch@r$( :) & )speci@! ch@r$(number)speci@! ch@r$(s 222.)speci@! ch@r$(This i)speci@! ch@r$(s \k w)speci@! ch@r$(rong e)speci@! ch@r$(scape )speci@! ch@r$(char.)speci@! ch@r$(" +Done diff --git a/ext/standard/tests/strings/chunk_split_variation12.phpt b/ext/standard/tests/strings/chunk_split_variation12.phpt new file mode 100644 index 0000000000..b440f56cd3 --- /dev/null +++ b/ext/standard/tests/strings/chunk_split_variation12.phpt @@ -0,0 +1,206 @@ +--TEST-- +Test chunk_split() function : usage variations - different heredoc strings for 'ending' argument +--FILE-- + +--EXPECTF-- +*** Testing chunk_split() : different heredoc strings for 'ending' argument *** +-- Iteration 1 -- +string(102) "This is str to check with heredoc ending.This contains, +speci@! ch@r$ __with wrong \k escape char 222." +-- Iteration 2 -- +string(102) "This is str to check with heredoc ending.This contains, +speci@! ch@r$ __with wrong \k escape char 222." +-- Iteration 3 -- +string(113) "This is star to checka with hereadoc endinga.This contaains, +specai@! ch@r$ a__with wroang \k escaape char 22a2.a" +-- Iteration 4 -- +string(421) "This is stThis is simple heredoc stringr to checkThis is simple heredoc string with hereThis is simple heredoc stringdoc endingThis is simple heredoc string.This contThis is simple heredoc stringains, +specThis is simple heredoc stringi@! ch@r$ This is simple heredoc string__with wroThis is simple heredoc stringng \k escaThis is simple heredoc stringpe char 22This is simple heredoc string2.This is simple heredoc string" +-- Iteration 5 -- +string(762) "This is stThis is to check chunk_split +function with multiline +heredocr to checkThis is to check chunk_split +function with multiline +heredoc with hereThis is to check chunk_split +function with multiline +heredocdoc endingThis is to check chunk_split +function with multiline +heredoc.This contThis is to check chunk_split +function with multiline +heredocains, +specThis is to check chunk_split +function with multiline +heredoci@! ch@r$ This is to check chunk_split +function with multiline +heredoc__with wroThis is to check chunk_split +function with multiline +heredocng \k escaThis is to check chunk_split +function with multiline +heredocpe char 22This is to check chunk_split +function with multiline +heredoc2.This is to check chunk_split +function with multiline +heredoc" +-- Iteration 6 -- +string(443) "This is stThis checks with $, %, &, charsr to checkThis checks with $, %, &, chars with hereThis checks with $, %, &, charsdoc endingThis checks with $, %, &, chars.This contThis checks with $, %, &, charsains, +specThis checks with $, %, &, charsi@! ch@r$ This checks with $, %, &, chars__with wroThis checks with $, %, &, charsng \k escaThis checks with $, %, &, charspe char 22This checks with $, %, &, chars2.This checks with $, %, &, chars" +-- Iteration 7 -- +string(487) "This is stThis checks and +white space charsr to checkThis checks and +white space chars with hereThis checks and +white space charsdoc endingThis checks and +white space chars.This contThis checks and +white space charsains, +specThis checks and +white space charsi@! ch@r$ This checks and +white space chars__with wroThis checks and +white space charsng \k escaThis checks and +white space charspe char 22This checks and +white space chars2.This checks and +white space chars" +-- Iteration 8 -- +string(597) "This is st"To check " in heredoc".I'm sure it'll \work!r to check"To check " in heredoc".I'm sure it'll \work! with here"To check " in heredoc".I'm sure it'll \work!doc ending"To check " in heredoc".I'm sure it'll \work!.This cont"To check " in heredoc".I'm sure it'll \work!ains, +spec"To check " in heredoc".I'm sure it'll \work!i@! ch@r$ "To check " in heredoc".I'm sure it'll \work!__with wro"To check " in heredoc".I'm sure it'll \work!ng \k esca"To check " in heredoc".I'm sure it'll \work!pe char 22"To check " in heredoc".I'm sure it'll \work!2."To check " in heredoc".I'm sure it'll \work!" +Done + +--UEXPECTF-- +*** Testing chunk_split() : different heredoc strings for 'ending' argument *** +-- Iteration 1 -- +unicode(102) "This is str to check with heredoc ending.This contains, +speci@! ch@r$ __with wrong \k escape char 222." +-- Iteration 2 -- +unicode(102) "This is str to check with heredoc ending.This contains, +speci@! ch@r$ __with wrong \k escape char 222." +-- Iteration 3 -- +unicode(113) "This is star to checka with hereadoc endinga.This contaains, +specai@! ch@r$ a__with wroang \k escaape char 22a2.a" +-- Iteration 4 -- +unicode(421) "This is stThis is simple heredoc stringr to checkThis is simple heredoc string with hereThis is simple heredoc stringdoc endingThis is simple heredoc string.This contThis is simple heredoc stringains, +specThis is simple heredoc stringi@! ch@r$ This is simple heredoc string__with wroThis is simple heredoc stringng \k escaThis is simple heredoc stringpe char 22This is simple heredoc string2.This is simple heredoc string" +-- Iteration 5 -- +unicode(762) "This is stThis is to check chunk_split +function with multiline +heredocr to checkThis is to check chunk_split +function with multiline +heredoc with hereThis is to check chunk_split +function with multiline +heredocdoc endingThis is to check chunk_split +function with multiline +heredoc.This contThis is to check chunk_split +function with multiline +heredocains, +specThis is to check chunk_split +function with multiline +heredoci@! ch@r$ This is to check chunk_split +function with multiline +heredoc__with wroThis is to check chunk_split +function with multiline +heredocng \k escaThis is to check chunk_split +function with multiline +heredocpe char 22This is to check chunk_split +function with multiline +heredoc2.This is to check chunk_split +function with multiline +heredoc" +-- Iteration 6 -- +unicode(443) "This is stThis checks with $, %, &, charsr to checkThis checks with $, %, &, chars with hereThis checks with $, %, &, charsdoc endingThis checks with $, %, &, chars.This contThis checks with $, %, &, charsains, +specThis checks with $, %, &, charsi@! ch@r$ This checks with $, %, &, chars__with wroThis checks with $, %, &, charsng \k escaThis checks with $, %, &, charspe char 22This checks with $, %, &, chars2.This checks with $, %, &, chars" +-- Iteration 7 -- +unicode(487) "This is stThis checks and +white space charsr to checkThis checks and +white space chars with hereThis checks and +white space charsdoc endingThis checks and +white space chars.This contThis checks and +white space charsains, +specThis checks and +white space charsi@! ch@r$ This checks and +white space chars__with wroThis checks and +white space charsng \k escaThis checks and +white space charspe char 22This checks and +white space chars2.This checks and +white space chars" +-- Iteration 8 -- +unicode(597) "This is st"To check " in heredoc".I'm sure it'll \work!r to check"To check " in heredoc".I'm sure it'll \work! with here"To check " in heredoc".I'm sure it'll \work!doc ending"To check " in heredoc".I'm sure it'll \work!.This cont"To check " in heredoc".I'm sure it'll \work!ains, +spec"To check " in heredoc".I'm sure it'll \work!i@! ch@r$ "To check " in heredoc".I'm sure it'll \work!__with wro"To check " in heredoc".I'm sure it'll \work!ng \k esca"To check " in heredoc".I'm sure it'll \work!pe char 22"To check " in heredoc".I'm sure it'll \work!2."To check " in heredoc".I'm sure it'll \work!" +Done \ No newline at end of file diff --git a/ext/standard/tests/strings/chunk_split_variation13.phpt b/ext/standard/tests/strings/chunk_split_variation13.phpt new file mode 100644 index 0000000000..f019f0d271 --- /dev/null +++ b/ext/standard/tests/strings/chunk_split_variation13.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test chunk_split() function : usage variations - default 'chunklen' with long string as 'str' +--FILE-- + +--EXPECTF-- +*** Testing chunk_split() : default 'chunklen' with long string 'str' *** +-- Iteration 0 -- +string(85) "1234567890123456789012345678901234567890123456789012345678901234567890123456 +78901 +" +-- Iteration 1 -- +string(217) "1234567890123456789012345678901234567890123456789012345678901234567890123456 +7890123456789012345678901234567890123456789012345678901234567890123456789012 +34567890123456789012345678901234567890123456789012345678901 +" +Done + +--UEXPECTF-- +*** Testing chunk_split() : default 'chunklen' with long string 'str' *** +-- Iteration 0 -- +unicode(85) "1234567890123456789012345678901234567890123456789012345678901234567890123456 +78901 +" +-- Iteration 1 -- +unicode(217) "1234567890123456789012345678901234567890123456789012345678901234567890123456 +7890123456789012345678901234567890123456789012345678901234567890123456789012 +34567890123456789012345678901234567890123456789012345678901 +" +Done \ No newline at end of file diff --git a/ext/standard/tests/strings/chunk_split_variation2.phpt b/ext/standard/tests/strings/chunk_split_variation2.phpt new file mode 100644 index 0000000000..5f1cb076fd --- /dev/null +++ b/ext/standard/tests/strings/chunk_split_variation2.phpt @@ -0,0 +1,274 @@ +--TEST-- +Test chunk_split() function : usage variations - unexpected values for 'chunklen' argument +--FILE-- + 'red', 'item' => 'pen'), + + // null data + NULL, + null, + + // boolean data + true, + false, + TRUE, + FALSE, + + // empty data + "", + '', + + // string data + "string", + 'string', + + // object data + new MyClass(), + + // undefined data + @$undefined_var, + + // unset data + @$unset_var, + + // resource variable + $fp +); + +// loop through each element of the values for 'chunklen' +for($count = 0; $count < count($values); $count++) { + echo "-- Iteration ".($count+1)." --\n"; + var_dump( chunk_split($str, $values[$count], $ending) ); +} + +echo "Done"; + +//closing resource +fclose($fp); + +?> +--EXPECTF-- +*** Testing chunk_split() : with unexpected values for 'chunklen' argument *** +-- Iteration 1 -- +string(28) "This is ch*uklen vari*ation*" +-- Iteration 2 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d +bool(false) +-- Iteration 3 -- +string(26) "This is chuklen variation*" +-- Iteration 4 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d +bool(false) +-- Iteration 5 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d +bool(false) +-- Iteration 6 -- + +Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d%d +NULL +-- Iteration 7 -- + +Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d%d +NULL +-- Iteration 8 -- + +Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d%d +NULL +-- Iteration 9 -- + +Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d%d +NULL +-- Iteration 10 -- + +Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d%d +NULL +-- Iteration 11 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d +bool(false) +-- Iteration 12 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d +bool(false) +-- Iteration 13 -- +string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*" +-- Iteration 14 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d +bool(false) +-- Iteration 15 -- +string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*" +-- Iteration 16 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d +bool(false) +-- Iteration 17 -- + +Warning: chunk_split() expects parameter 2 to be long, string given in %s on line %d%d +NULL +-- Iteration 18 -- + +Warning: chunk_split() expects parameter 2 to be long, string given in %s on line %d%d +NULL +-- Iteration 19 -- + +Warning: chunk_split() expects parameter 2 to be long, string given in %s on line %d%d +NULL +-- Iteration 20 -- + +Warning: chunk_split() expects parameter 2 to be long, string given in %s on line %d%d +NULL +-- Iteration 21 -- + +Warning: chunk_split() expects parameter 2 to be long, object given in %s on line %d%d +NULL +-- Iteration 22 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d +bool(false) +-- Iteration 23 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d +bool(false) +-- Iteration 24 -- + +Warning: chunk_split() expects parameter 2 to be long, resource given in %s on line %d%d +NULL +Done + +--UEXPECTF-- +*** Testing chunk_split() : with unexpected values for 'chunklen' argument *** +-- Iteration 1 -- +unicode(28) "This is ch*uklen vari*ation*" +-- Iteration 2 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +bool(false) +-- Iteration 3 -- +unicode(26) "This is chuklen variation*" +-- Iteration 4 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +bool(false) +-- Iteration 5 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +bool(false) +-- Iteration 6 -- + +Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d +NULL +-- Iteration 7 -- + +Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d +NULL +-- Iteration 8 -- + +Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d +NULL +-- Iteration 9 -- + +Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d +NULL +-- Iteration 10 -- + +Warning: chunk_split() expects parameter 2 to be long, array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +bool(false) +-- Iteration 12 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +bool(false) +-- Iteration 13 -- +unicode(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*" +-- Iteration 14 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +bool(false) +-- Iteration 15 -- +unicode(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*" +-- Iteration 16 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +bool(false) +-- Iteration 17 -- + +Warning: chunk_split() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL +-- Iteration 18 -- + +Warning: chunk_split() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL +-- Iteration 19 -- + +Warning: chunk_split() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL +-- Iteration 20 -- + +Warning: chunk_split() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL +-- Iteration 21 -- + +Warning: chunk_split() expects parameter 2 to be long, object given in %s on line %d +NULL +-- Iteration 22 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +bool(false) +-- Iteration 23 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +bool(false) +-- Iteration 24 -- + +Warning: chunk_split() expects parameter 2 to be long, resource given in %s on line %d +NULL +Done diff --git a/ext/standard/tests/strings/chunk_split_variation3.phpt b/ext/standard/tests/strings/chunk_split_variation3.phpt new file mode 100644 index 0000000000..cfd1a1e3a6 --- /dev/null +++ b/ext/standard/tests/strings/chunk_split_variation3.phpt @@ -0,0 +1,228 @@ +--TEST-- +Test chunk_split() function : usage variations - unexpected values for 'ending' argument +--FILE-- + 'red', 'item' => 'pen'), + + // null data + NULL, + null, + + // boolean data + true, + false, + TRUE, + FALSE, + + // empty data + "", + '', + + // object data + new MyClass(), + + // undefined data + @$undefined_var, + + // unset data + @$unset_var, + + // resource data + $fp +); + +// loop through each element of values for 'ending' +for($count = 0; $count < count($values); $count++) { + echo "-- Iteration ".($count+1)." --\n"; + var_dump( chunk_split($str, $chunklen, $values[$count]) ); +} + +echo "Done"; + +//closing resource +fclose($fp); +?> +--EXPECTF-- +*** Testing chunk_split() : unexpected values for 'ending' *** +-- Iteration 1 -- +string(28) "This0 is 0simp0le s0trin0g.0" +-- Iteration 2 -- +string(28) "This1 is 1simp1le s1trin1g.1" +-- Iteration 3 -- +string(52) "This12345 is 12345simp12345le s12345trin12345g.12345" +-- Iteration 4 -- +string(52) "This-2345 is -2345simp-2345le s-2345trin-2345g.-2345" +-- Iteration 5 -- +string(46) "This10.5 is 10.5simp10.5le s10.5trin10.5g.10.5" +-- Iteration 6 -- +string(52) "This-10.5 is -10.5simp-10.5le s-10.5trin-10.5g.-10.5" +-- Iteration 7 -- +string(94) "This105000000000 is 105000000000simp105000000000le s105000000000trin105000000000g.105000000000" +-- Iteration 8 -- +string(64) "This1.06E-9 is 1.06E-9simp1.06E-9le s1.06E-9trin1.06E-9g.1.06E-9" +-- Iteration 9 -- +string(40) "This0.5 is 0.5simp0.5le s0.5trin0.5g.0.5" +-- Iteration 10 -- + +Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d%d +NULL +-- Iteration 11 -- + +Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d%d +NULL +-- Iteration 12 -- + +Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d%d +NULL +-- Iteration 13 -- + +Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d%d +NULL +-- Iteration 14 -- + +Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d%d +NULL +-- Iteration 15 -- +string(22) "This is simple string." +-- Iteration 16 -- +string(22) "This is simple string." +-- Iteration 17 -- +string(28) "This1 is 1simp1le s1trin1g.1" +-- Iteration 18 -- +string(22) "This is simple string." +-- Iteration 19 -- +string(28) "This1 is 1simp1le s1trin1g.1" +-- Iteration 20 -- +string(22) "This is simple string." +-- Iteration 21 -- +string(22) "This is simple string." +-- Iteration 22 -- +string(22) "This is simple string." +-- Iteration 23 -- +string(58) "Thisobject is objectsimpobjectle sobjecttrinobjectg.object" +-- Iteration 24 -- +string(22) "This is simple string." +-- Iteration 25 -- +string(22) "This is simple string." +-- Iteration 26 -- + +Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), resource given in %s on line %d%d +NULL +Done + +--UEXPECTF-- +*** Testing chunk_split() : unexpected values for 'ending' *** +-- Iteration 1 -- +unicode(28) "This0 is 0simp0le s0trin0g.0" +-- Iteration 2 -- +unicode(28) "This1 is 1simp1le s1trin1g.1" +-- Iteration 3 -- +unicode(52) "This12345 is 12345simp12345le s12345trin12345g.12345" +-- Iteration 4 -- +unicode(52) "This-2345 is -2345simp-2345le s-2345trin-2345g.-2345" +-- Iteration 5 -- +unicode(46) "This10.5 is 10.5simp10.5le s10.5trin10.5g.10.5" +-- Iteration 6 -- +unicode(52) "This-10.5 is -10.5simp-10.5le s-10.5trin-10.5g.-10.5" +-- Iteration 7 -- +unicode(94) "This105000000000 is 105000000000simp105000000000le s105000000000trin105000000000g.105000000000" +-- Iteration 8 -- +unicode(64) "This1.06E-9 is 1.06E-9simp1.06E-9le s1.06E-9trin1.06E-9g.1.06E-9" +-- Iteration 9 -- +unicode(40) "This0.5 is 0.5simp0.5le s0.5trin0.5g.0.5" +-- Iteration 10 -- + +Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 12 -- + +Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 13 -- + +Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 14 -- + +Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), array given in %s on line %d +NULL +-- Iteration 15 -- +unicode(22) "This is simple string." +-- Iteration 16 -- +unicode(22) "This is simple string." +-- Iteration 17 -- +unicode(28) "This1 is 1simp1le s1trin1g.1" +-- Iteration 18 -- +unicode(22) "This is simple string." +-- Iteration 19 -- +unicode(28) "This1 is 1simp1le s1trin1g.1" +-- Iteration 20 -- +unicode(22) "This is simple string." +-- Iteration 21 -- +unicode(22) "This is simple string." +-- Iteration 22 -- +unicode(22) "This is simple string." +-- Iteration 23 -- +unicode(58) "Thisobject is objectsimpobjectle sobjecttrinobjectg.object" +-- Iteration 24 -- +unicode(22) "This is simple string." +-- Iteration 25 -- +unicode(22) "This is simple string." +-- Iteration 26 -- + +Warning: chunk_split() expects parameter 3 to be string (Unicode or binary), resource given in %s on line %d +NULL +Done diff --git a/ext/standard/tests/strings/chunk_split_variation4.phpt b/ext/standard/tests/strings/chunk_split_variation4.phpt new file mode 100644 index 0000000000..e7918a7414 --- /dev/null +++ b/ext/standard/tests/strings/chunk_split_variation4.phpt @@ -0,0 +1,268 @@ +--TEST-- +Test chunk_split() function : usage variations - different heredoc strings as 'str' argument +--FILE-- + +--EXPECTF-- +*** Testing chunk_split() : heredoc strings as 'str' argument *** +-- Iteration 1 -- +string(2) " +" +-- Iteration 2 -- +string(2) " +" +-- Iteration 3 -- +string(3) "a +" +-- Iteration 4 -- +string(45) "This + is +simp +le h +ered +oc s +trin +g +" +-- Iteration 5 -- +string(90) "This + is +to c +heck + chu +nk_s +plit + +fun +ctio +n wi +th m +ulti +line + +her +edoc +" +-- Iteration 6 -- +string(59) "This + che +cks +here +doc +with + $, +%, & +, ch +ars +" +-- Iteration 7 -- +string(59) "This + che +cks + chu +nk_s +plit +() +E +scap +e +ch +ars +" +-- Iteration 8 -- +string(117) ""To +chec +k " +in h +ered +oc" + +I'm +sure + it' +ll w +ork +also + wit +h \ + +whic +h is + sin +gle +slas +h +" +Done + +--UEXPECTF-- +*** Testing chunk_split() : heredoc strings as 'str' argument *** +-- Iteration 1 -- +unicode(2) " +" +-- Iteration 2 -- +unicode(2) " +" +-- Iteration 3 -- +unicode(3) "a +" +-- Iteration 4 -- +unicode(45) "This + is +simp +le h +ered +oc s +trin +g +" +-- Iteration 5 -- +unicode(90) "This + is +to c +heck + chu +nk_s +plit + +fun +ctio +n wi +th m +ulti +line + +her +edoc +" +-- Iteration 6 -- +unicode(59) "This + che +cks +here +doc +with + $, +%, & +, ch +ars +" +-- Iteration 7 -- +unicode(59) "This + che +cks + chu +nk_s +plit +() +E +scap +e +ch +ars +" +-- Iteration 8 -- +unicode(117) ""To +chec +k " +in h +ered +oc" + +I'm +sure + it' +ll w +ork +also + wit +h \ + +whic +h is + sin +gle +slas +h +" +Done diff --git a/ext/standard/tests/strings/chunk_split_variation5.phpt b/ext/standard/tests/strings/chunk_split_variation5.phpt new file mode 100644 index 0000000000000000000000000000000000000000..170f9e136403a7ea51c587c46ac970ec090bea45 GIT binary patch literal 3266 zcmeHJ?{CvE5alcWD^68`rdyWv2NV^?gkVUO_<*1YBsL*8aT{x?9oY^VaQyF_ou;I~ z1W0Tj5MP$$e17lz?)=s`o}av$$1$4=>mbc5b^hL#g>=0LmX%7K)C#6hS-ukRfg8zv z#6k?2TrPzX%7Ii)tc0QEq7oLC+Q6NFR0wqkxLH+eN@H>SZ1((ws2(1ddC8JKyfE5n z_puZ}6xJE3Ry!qZLS1^oyM50C-3HhPnsuQv+In^tG3dinVN)YZU*;5E3Rf8_HyjBH zsf15?r7M#PNOdNrATC^D9akAQ8NK)-4pN`>xRBg}(_00_QtOUfw6rLw197ZOjTgg_N@1Ghm{>xD2D2E)<8shT<9h4se~>3QA!)5DPJ z`IDqob89}DF0$?>ctmqz_($k5fWv(NdJO7EOg!|KBucDk_&$hc-hAe8G!APzbyQ$o znU7x#9*1}?E_g=OuiLA`!FV#hKe{)bgq$_MfKpph=^OSpsBQB7OOy8oL>YgdC>8ur zF^fnOx*xr6sw|MC^vuMC+sJ7awE72nbhvd#%-dBZ|9{%)T +--EXPECTF-- +*** Testing chunk_split() : with different single quoted 'str' *** +-- Iteration 0 -- +string(3) "):(" +-- Iteration 1 -- +string(4) " ):(" +-- Iteration 2 -- +string(30) "This is):( simple):( string):(" +-- Iteration 3 -- +string(35) "It's st):(ring wi):(th quot):(es):(" +-- Iteration 4 -- +string(46) "This co):(ntains ):(@ # $ %):( ^ & ch):(ars):(" +-- Iteration 5 -- +string(59) "This st):(ring\tc):(ontains):(\rwhite):( space\):(nchars):(" +-- Iteration 6 -- +string(47) "This is):( string):( with 1):(234 num):(bers):(" +-- Iteration 7 -- +string(68) "This is):( string):( with \):(0 and "):(.chr(0)):(."null ):(chars):(" +-- Iteration 8 -- +string(74) "This is):( string):( with ):( multi):(ple ):( sp):(ace cha):(r):(" +-- Iteration 9 -- +string(46) "This is):( to che):(ck stri):(ng with):( ()):(" +-- Iteration 10 -- +string(44) " Te):(sting w):(ith ):(Tab ):( ):(" +-- Iteration 11 -- +string(55) "Testing):( invali):(d \k an):(d \m es):(cape ch):(ar):(" +-- Iteration 12 -- +string(46) "This is):( to che):(ck with):( \n and):( \t):(" +Done + +--UEXPECTF-- +*** Testing chunk_split() : with different single quoted 'str' *** +-- Iteration 0 -- +unicode(3) "):(" +-- Iteration 1 -- +unicode(4) " ):(" +-- Iteration 2 -- +unicode(30) "This is):( simple):( string):(" +-- Iteration 3 -- +unicode(35) "It's st):(ring wi):(th quot):(es):(" +-- Iteration 4 -- +unicode(46) "This co):(ntains ):(@ # $ %):( ^ & ch):(ars):(" +-- Iteration 5 -- +unicode(59) "This st):(ring\tc):(ontains):(\rwhite):( space\):(nchars):(" +-- Iteration 6 -- +unicode(47) "This is):( string):( with 1):(234 num):(bers):(" +-- Iteration 7 -- +unicode(68) "This is):( string):( with \):(0 and "):(.chr(0)):(."null ):(chars):(" +-- Iteration 8 -- +unicode(74) "This is):( string):( with ):( multi):(ple ):( sp):(ace cha):(r):(" +-- Iteration 9 -- +unicode(46) "This is):( to che):(ck stri):(ng with):( ()):(" +-- Iteration 10 -- +unicode(44) " Te):(sting w):(ith ):(Tab ):( ):(" +-- Iteration 11 -- +unicode(55) "Testing):( invali):(d \k an):(d \m es):(cape ch):(ar):(" +-- Iteration 12 -- +unicode(46) "This is):( to che):(ck with):( \n and):( \t):(" +Done \ No newline at end of file diff --git a/ext/standard/tests/strings/chunk_split_variation7.phpt b/ext/standard/tests/strings/chunk_split_variation7.phpt new file mode 100644 index 0000000000000000000000000000000000000000..1b1afd3f8bed37719c5c6fcc3712bb082deb2983 GIT binary patch literal 3446 zcmc&$ZExE)5boFVR~$5Nv7IQko0l$0({xxUQ*@+0S^nMpfCKvC?cWc5?7r2}8AD&bDS6h?{R zNMQH^6OhhP&<_nk{+*53y6YI*J!_k@Og`&baL>Ks~@2(Tw^d)-r$vJl1%DcV*h@w4!(MT;z ze@9;-e0QZx6@8y(+5!GKy)1EpLbZa8Rf{T@wmu`{E5C!5VMw?NJaDe2tcRyCUTQ;$ zQD2&=T=`1Fa|f^BJLtjp@H_l~ZIG5}Fw{1`D^-eh;^#8;%DNR#FiU*Hm)K94_Lu=> zmY5ae>H;O%3VrhI;1Eo;yg^b*;32zY3^(_HQXddkD4&WawaM-OlhAV6(%NW+RCfc1~Z6S_nN2nRN6(48S zvg~8ZYe|Hf`a|$|y|-2)gkfI>fNA|JMDX?+)glrXFH!q0e|vZN^YjhM-*(m;U9>Wr zU@{_1T>o%TuW;AoS#oZ!8(|))L^&CBWVYEa)xj5*@aQ4v>hq znGDz0XoBb@qn{E2UOD>MpgL+%9i6me;%%fG8WsN)0p4-~yy<*GGfdz<>f;vm^KqMc z9pzK>Lib5$m_yL&(+RIX0Tj11BY?U>9~%igZ+SWHcwv>G8~jU1fQ60#D+U2p4FdOa z|Jdg46z37{C$zFe2~SX82(ZQwxYx-^%gM=?CcqNJ+$2K;Sc(X+A`xIo;*+LJ8>O3! zTdt2eKhi9^f|9SfF|1uoLi)vzP|B8kLOMo(wTwWRg-tK*?dgsfR?+ipqA;kG7+ClS zWTbHfNU;+FJQa~35fHczzkUM=sEnq6avs%y#^zBGXpH{93apsEf($fV-6nk<9cZ|> hECh|4tti2Ye5+E>c=;Au(D>f67&LCWgZ5w5;4@!G9S#5h literal 0 HcmV?d00001 diff --git a/ext/standard/tests/strings/chunk_split_variation8.phpt b/ext/standard/tests/strings/chunk_split_variation8.phpt new file mode 100644 index 0000000000..c3ceeceb4c --- /dev/null +++ b/ext/standard/tests/strings/chunk_split_variation8.phpt @@ -0,0 +1,128 @@ +--TEST-- +Test chunk_split() function : usage variations - different integer values for 'chunklen' with heredoc string as 'str' +--FILE-- + +--EXPECTF-- +*** Testing chunk_split() : different 'chunklen' with heredoc 'str' *** +-- Iteration 1 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d +bool(false) +-- Iteration 2 -- +string(504) "T:::h:::i:::s:::':::s::: :::h:::e:::r:::e:::d:::o:::c::: :::s:::t:::r:::i:::n:::g::: :::w:::i:::t:::h::: ::: ::: :::a:::n:::d::: ::: +::: :::w:::h:::i:::t:::e::: :::s:::p:::a:::c:::e::: :::c:::h:::a:::r:::.::: +:::I:::t::: :::h:::a:::s::: :::_:::s:::p:::e:::c:::i:::@:::l::: :::c:::h:::@:::r:::$::: :::2:::2:::2:::2::: :::!:::!:::!:::N:::o:::w::: :::\:::k::: :::a:::s::: :::e:::s:::c:::a:::p:::e::: :::c:::h:::a:::r::: :::t:::o::: :::t:::e:::s:::t::: +:::c:::h:::u:::n:::k:::_:::s:::p:::l:::i:::t:::(:::):::" +-- Iteration 3 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d +bool(false) +-- Iteration 4 -- +string(129) "This's heredoc string with and + white space char. +It has _speci@l ch@r$ 2222 !!!Now \k as escape char to test +chunk_split():::" +-- Iteration 5 -- +string(141) "This's heredoc string with::: and + white space char.::: +It has _speci@l ch@r$ 222:::2 !!!Now \k as escape char::: to test +chunk_split():::" +-- Iteration 6 -- +string(129) "This's heredoc string with and + white space char. +It has _speci@l ch@r$ 2222 !!!Now \k as escape char to test +chunk_split():::" +-- Iteration 7 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d +bool(false) +-- Iteration 8 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d%d +bool(false) +Done + +--UEXPECTF-- +*** Testing chunk_split() : different 'chunklen' with heredoc 'str' *** +-- Iteration 1 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +bool(false) +-- Iteration 2 -- +unicode(504) "T:::h:::i:::s:::':::s::: :::h:::e:::r:::e:::d:::o:::c::: :::s:::t:::r:::i:::n:::g::: :::w:::i:::t:::h::: ::: ::: :::a:::n:::d::: ::: +::: :::w:::h:::i:::t:::e::: :::s:::p:::a:::c:::e::: :::c:::h:::a:::r:::.::: +:::I:::t::: :::h:::a:::s::: :::_:::s:::p:::e:::c:::i:::@:::l::: :::c:::h:::@:::r:::$::: :::2:::2:::2:::2::: :::!:::!:::!:::N:::o:::w::: :::\:::k::: :::a:::s::: :::e:::s:::c:::a:::p:::e::: :::c:::h:::a:::r::: :::t:::o::: :::t:::e:::s:::t::: +:::c:::h:::u:::n:::k:::_:::s:::p:::l:::i:::t:::(:::):::" +-- Iteration 3 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +bool(false) +-- Iteration 4 -- +unicode(129) "This's heredoc string with and + white space char. +It has _speci@l ch@r$ 2222 !!!Now \k as escape char to test +chunk_split():::" +-- Iteration 5 -- +unicode(141) "This's heredoc string with::: and + white space char.::: +It has _speci@l ch@r$ 222:::2 !!!Now \k as escape char::: to test +chunk_split():::" +-- Iteration 6 -- +unicode(129) "This's heredoc string with and + white space char. +It has _speci@l ch@r$ 2222 !!!Now \k as escape char to test +chunk_split():::" +-- Iteration 7 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +bool(false) +-- Iteration 8 -- + +Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +bool(false) +Done diff --git a/ext/standard/tests/strings/chunk_split_variation9.phpt b/ext/standard/tests/strings/chunk_split_variation9.phpt new file mode 100644 index 0000000000000000000000000000000000000000..57441716567859c17c3767e4f2f85a8d83e5a517 GIT binary patch literal 5440 zcmds4?{Cyb5WTOrf5p^2#N82dxj+I0Qc{tCBDE1}QneCEk@0POR-Lu$AJDYw|K8bo z>zvm_{ZK9yMT+9*XYal@voq_xFg!gxISoT~s;ipfWn+GQTNPPak0*4|n7B@JL%Y;e zQKIR6RHl(-Dhg?lUR>x>o0=AR^Dfi$Ta(v%K~-I*CaLHmFX^r}3%EG*FRYztKl?w(og8Q+3>)R}iDysAA zWK_Fka-Ly2Q|w+%sfenIU;lUcurqr}mw9!(%qf^or({>fPVT+Kd0HhOW_#)8p=Ty| z$_{5oCau#bOaHLb$O7_ORZ7yiN5Sbbt%(2FNBwaHd`Ro149c5|kYJZ@o_w_md$ed~kI93Xe*iG+9(Si}vaM*P}bXxN(J!IT13jQv7f>qYulp)?62?;CLQ$R@(t~ zH0Q8IWw0SkX*oMOINQX$$4!PwEjizM(6X1hOu2+87=M5AY6A8ro6j+Eoe`HQ1rsl) zW4u&xpJ>C5xbVE^GQu>M?{rxaD?O9}!d5o8{jWHP{cUMyx}+YX!9v|nc!#KBFv55noZgV_wG&TPZme9h9Mo*x|H3a z9T|pFgk&q|?V`CX#_Vsk!PpYqSoJbPxOxNO^9gYfe<=ll18%xNJ^zMxki(x}AHFz! z$(zWhwFpnuF}+DVA-ZY2y)*fQ*6`<@cjnz$%}eMxLemk_!kd%bcnN*S&5_#1LlsaW zbxqvHfv>Q2vjX<5I)Xw31>Om)LgYFd3K0|{C`2ZSdI}FZ3iJ6Y2s9re0frbb6oDZN z3~gW-0EP=-SOGQ(u02x^yQVf*rljZLNgyl44BoKZC!j3?=5ePE^O(K_`mFC^3Y~QrAWH*eX@D#Zkfi~#G(eUH$kG5=8kl6z%hJ5NO*~!&!P_xJ z7(j*rgcv}I0mK+UjsXN2K$3w;_+MYPyNk>_#V#KgC<}zPK&T6ZzCbt-2oD0`LLhty zG>KgLUb_3uR>w>4YX(<668?H5oc2g~?vZfcBN0cBL_|FjvGquk^oV}E-tPBgwdND= zTkOL1I2WzQxnMoc#p-b`RF89!dYlW?<6N8`$6TG86nMbh;M2QPTVGBe#3q%nMMCl4d!3so~3jBvtMC+xq&g(u#+#s>W zZ?K#rZdXDM60O87o+Mg{&RVSfDA8*C*Jp`V_p>-mv}U~Tj`!Pl{AHac+JNU@_Hm*O O(_2^nv;03lPy7vNHn7tG literal 0 HcmV?d00001 -- 2.50.1