Test that replace handles introducing newlines