diff --git a/tests/PhpSpreadsheetTests/Reader/CsvTest.php b/tests/PhpSpreadsheetTests/Reader/CsvTest.php index cb2b6196..e4ccd931 100644 --- a/tests/PhpSpreadsheetTests/Reader/CsvTest.php +++ b/tests/PhpSpreadsheetTests/Reader/CsvTest.php @@ -200,6 +200,37 @@ EOF; self::assertEquals($expected, $sheet->getCell('B3')->getValue()); } + public function testLineBreakEscape(): void + { + $reader = new Csv(); + $spreadsheet = $reader->load('tests/data/Reader/CSV/line_break_in_enclosure_with_escaped_quotes.csv'); + $sheet = $spreadsheet->getActiveSheet(); + $expected = <<getCell('B3')->getValue()); + } + + public function testUtf32LineBreakEscape(): void + { + $reader = new Csv(); + $reader->setInputEncoding('UTF-32LE'); + $spreadsheet = $reader->load('tests/data/Reader/CSV/line_break_escaped_32le.csv'); + $sheet = $spreadsheet->getActiveSheet(); + $expected = <<getCell('B3')->getValue()); + } + public function testSeparatorLine(): void { $reader = new Csv(); diff --git a/tests/data/Reader/CSV/line_break_escaped_32le.csv b/tests/data/Reader/CSV/line_break_escaped_32le.csv new file mode 100644 index 00000000..8e0f0243 Binary files /dev/null and b/tests/data/Reader/CSV/line_break_escaped_32le.csv differ diff --git a/tests/data/Reader/CSV/line_break_in_enclosure_with_escaped_quotes.csv b/tests/data/Reader/CSV/line_break_in_enclosure_with_escaped_quotes.csv index e84db1b5..01ce36a6 100644 --- a/tests/data/Reader/CSV/line_break_in_enclosure_with_escaped_quotes.csv +++ b/tests/data/Reader/CSV/line_break_in_enclosure_with_escaped_quotes.csv @@ -1,21 +1,21 @@ Name,Copy,URL -Test,"This is a \"test csv file\" -with both \"line breaks\" -and \"escaped -quotes\" that breaks +Test,"This is a ""test csv file"" +with both ""line breaks"" +and ""escaped +quotes"" that breaks the delimiters",http://google.com -Test,"This is a \"test csv file\" -with both \"line breaks\" -and \"escaped -quotes\" that breaks +Test,"This is a ""test csv file"" +with both ""line breaks"" +and ""escaped +quotes"" that breaks the delimiters",http://google.com -Test,"This is a \"test csv file\" -with both \"line breaks\" -and \"escaped -quotes\" that breaks +Test,"This is a ""test csv file"" +with both ""line breaks"" +and ""escaped +quotes"" that breaks the delimiters",http://google.com -Test,"This is a \"test csv file\" -with both \"line breaks\" -and \"escaped -quotes\" that breaks +Test,"This is a ""test csv file"" +with both ""line breaks"" +and ""escaped +quotes"" that breaks the delimiters",http://google.com