Replace manual escapes in tests with helper