jinja : fix split and replace with empty first arg (#24574)
* fix split and replace with empty first arg * fix reserve size
This commit is contained in:
@@ -1320,6 +1320,12 @@ static void test_string_methods(testing & t) {
|
||||
"hello jinja"
|
||||
);
|
||||
|
||||
test_template(t, "string.replace() empty",
|
||||
"{{ s.replace('', '.') }}",
|
||||
{{"s", "hello world"}},
|
||||
".h.e.l.l.o. .w.o.r.l.d."
|
||||
);
|
||||
|
||||
test_template(t, "string.replace() with count",
|
||||
"{{ s.replace('a', 'X', 2) }}",
|
||||
{{"s", "banana"}},
|
||||
|
||||
Reference in New Issue
Block a user