Passed test for newline by replacing them with commas. Added test for custom delimiter.