csvparser: Unit tests for old Mac line endings and empty strings

This commit is contained in:
Samir Aguiar
2015-03-04 20:47:37 +01:00
parent ca38995013
commit f1ac26e216

View File

@@ -96,6 +96,25 @@ void TestImport::csvImport_data()
<< "UTF-8"
<< 3
<< result;
QTest::newRow("oldmaclinebreaks") << "a,b,c\rd,e,f\rg,h,i\r"
<< ','
<< (char)0
<< "UTF-8"
<< 3
<< result;
result.clear();
result.append(QStringList() << "a" << "b" << "");
result.append(QStringList() << "c" << "");
result.append(QStringList() << "d" << "" << "e");
result.append(QStringList() << "");
result.append(QStringList() << "" << "" << "f");
QTest::newRow("emptyvalues") << "a,b,\nc,\nd,,e\n\n,,f"
<< ','
<< (char)0
<< "UTF-8"
<< 3
<< result;
result.clear();
result.append(QStringList() << "a" << "b" << "c");