add replace support for tests