Test cases for replace function added