test and implementation for `replace/3`, `copy/3` and `move/3`