tests: Add test to check escaping quotes by using two of them

This commit is contained in:
Martin Kleusberg
2014-10-15 12:57:37 +02:00
parent c29702a1b9
commit b841025bae
2 changed files with 12 additions and 0 deletions

View File

@@ -213,6 +213,17 @@ void TestTable::parseNonASCIIChars()
QVERIFY(tab.fields().at(0)->name() == "Fieldöäüß");
}
void TestTable::parseSQLEscapedQuotes()
{
QString sSql = "CREATE TABLE double_quotes(a text default 'a''a');";
Table tab = Table::parseSQL(sSql).first;
QCOMPARE(tab.name(), QString("double_quotes"));
QCOMPARE(tab.fields().at(0)->name(), QString("a"));
QCOMPARE(tab.fields().at(0)->defaultValue(), QString("a''a"));
}
void TestTable::createTableWithIn()
{
QString sSQL = "CREATE TABLE not_working("