basic replace_patterns acceptance tests

(cherry picked from commit 3c8a5a2043adbd665bf747db54c165dcb9880af4)