# HG changeset patch # User abdelrahman@abdo # Date 1585028168 -7200 # Tue Mar 24 07:36:08 2020 +0200 # Node ID f6c4617ea68f1f9395875c1185bb4b354e7f5177 # Parent 4a605e5e95b22d40819594fc3e52df2b918cc52e maint: make self tests to the change occured to the strrep function of strfind.cc (bug#57867) diff -r 4a605e5e95b2 -r f6c4617ea68f strfind.cc --- a/strfind.cc Tue Mar 24 01:56:53 2020 +0200 +++ b/strfind.cc Tue Mar 24 07:36:08 2020 +0200 @@ -369,9 +369,16 @@ @group strrep ("This is a test string", "is", "&%$") @result{} "Th&%$ &%$ a test string" + +strrep(["Hello World";"Goodbye World"],"World","Jane") + @result{} + @{ + [1,1] = Hello Jane + [2,1] = Goodbye Jane + @} + @end group @end example - @seealso{regexprep, strfind} @end deftypefn */) { @@ -460,6 +467,8 @@ /* %!assert (strrep ("This is a test string", "is", "&%$"), %! "Th&%$ &%$ a test string") +%!assert (strrep (["Hello World";"Goodbye World"], "World", "Jane"), + {"Hello Jane";"Goodbye Jane"}) %!assert (strrep ("abababc", "abab", "xyz"), "xyzxyzc") %!assert (strrep ("abababc", "abab", "xyz", "overlaps", false), "xyzabc")