Add unit tests for escaping fix added in 84b64c65