rename replace func to replace_index

This commit is contained in:
starnakin 2023-07-25 09:41:07 +02:00
parent cb41e69bdb
commit 2b97d38b7e
3 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
replace(str, fill, start, stop) replace_index(str, fill, start, stop)
{ {
local out; local out;
local sum; local sum;

View File

@ -1,9 +0,0 @@
main()
{
name = "replace";
test_str(replace("yo ca va ?", "t", 2, 3), "yotca va ?", "");
test_str(replace("yo ca va ?", "", 2, 3), "yoca va ?", "empty fill");
test_str(replace("yo ca va ?", "aaaaa", 2, 3), "yoaaaaaca va ?", "");
test_str(replace("", "aaaaa", 0, 0), "aaaaa", "");
}

9
tests/replace_index.🗿 Normal file
View File

@ -0,0 +1,9 @@
main()
{
name = "replace_index";
test_str(replace_index("yo ca va ?", "t", 2, 3), "yotca va ?", "");
test_str(replace_index("yo ca va ?", "", 2, 3), "yoca va ?", "empty fill");
test_str(replace_index("yo ca va ?", "aaaaa", 2, 3), "yoaaaaaca va ?", "");
test_str(replace_index("", "aaaaa", 0, 0), "aaaaa", "");
}