Add a test case for replace