Closed Kishan-Ved closed 4 months ago
I don't get any errors upon running ./run_tests.py
locally. However, here, 2 checks fail due to this. Please let me know the fix for this. @Thirumalai-Shaktivel @Shaikh-Ubaid
It's the C test that fails, you can reproduce it using the following command:
$ cd integration_tests
$ ./run_tests.py -b c
Please mark this PR ready for review once it is ready!
It's the C test that fails, you can reproduce it using the following command:
$ cd integration_tests $ ./run_tests.py -b c
Fixed. Thank you @Thirumalai-Shaktivel .
@Shaikh-Ubaid @Thirumalai-Shaktivel Please let me know if this is good to be merged.
I think the implementation fails for the following example:
% cat examples/expr2.py
from lpython import i32
def main0():
x: str
x = "abc"
print(x.replace("", ","))
assert x.replace("", ",") == ",a,b,c,"
main0()
% python examples/expr2.py
,a,b,c,
% lpython examples/expr2.py
,a,b,c
AssertionError
I think the implementation fails for the following example:
% cat examples/expr2.py from lpython import i32 def main0(): x: str x = "abc" print(x.replace("", ",")) assert x.replace("", ",") == ",a,b,c," main0() % python examples/expr2.py ,a,b,c, % lpython examples/expr2.py ,a,b,c AssertionError
Fixed. Thanks.
Towards: https://github.com/lcompilers/lpython/issues/2356
In this PR, I have implemented
str.replace()
completely. Relevant tests have also been added.Parameters: