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.
This commit is contained in:
Geert Janssens 2023-02-22 14:45:44 +01:00
parent 7fbe42530f
commit b2703d8a02

View File

@ -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 } },
};