From b2703d8a027945c8f6bf04e20fbba01be03112f0 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Wed, 22 Feb 2023 14:45:44 +0100 Subject: [PATCH] CsvTokenizer - add additional test case for escaped quotes It simulates the case where csv fields are fully quoted and an escaped quote ("") is found in some field. This case is handled correctly, adding the test to guard this in potential future modifications. --- gnucash/import-export/csv-imp/test/test-tokenizer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gnucash/import-export/csv-imp/test/test-tokenizer.cpp b/gnucash/import-export/csv-imp/test/test-tokenizer.cpp index 2c69082397..aad18520e0 100644 --- a/gnucash/import-export/csv-imp/test/test-tokenizer.cpp +++ b/gnucash/import-export/csv-imp/test/test-tokenizer.cpp @@ -178,6 +178,7 @@ static tokenize_csv_test_data comma_separated [] = { { "Test\\ with backslash,nextfield", 2, { "Test\\ with backslash","nextfield",NULL,NULL,NULL,NULL,NULL,NULL } }, { "Test with \\\" escaped quote,nextfield", 2, { "Test with \" escaped quote","nextfield",NULL,NULL,NULL,NULL,NULL,NULL } }, { "Test with \"\" escaped quote,nextfield", 2, { "Test with \" escaped quote","nextfield",NULL,NULL,NULL,NULL,NULL,NULL } }, + { "\"Test (quoted) with \"\" escaped quote\",\"nextfield\"", 2, { "Test (quoted) with \" escaped quote","nextfield",NULL,NULL,NULL,NULL,NULL,NULL } }, { "\"Unescaped quote test\",nextfield", 2, { "Unescaped quote test","nextfield",NULL,NULL,NULL,NULL,NULL,NULL } }, { NULL, 0, { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } }, };