Tests: Add unit test for CHECK NOT LIKE constraint

Add a unit test for the grammar fix in
9cb0614ecf.
This commit is contained in:
Martin Kleusberg
2014-06-20 12:50:30 +02:00
parent 9cb0614ecf
commit 980f42d200
2 changed files with 13 additions and 1 deletions

View File

@@ -221,5 +221,17 @@ void TestTable::createTableWithIn()
QVERIFY(tab.fields().at(1)->check() == "value IN ( 'a' , 'b' , 'c' )");
}
void TestTable::createTableWithNotLikeConstraint()
{
QString sSQL = "CREATE TABLE hopefully_working("
"value TEXT CONSTRAINT 'value' CHECK(value NOT LIKE 'prefix%')"
");";
Table tab = Table::parseSQL(sSQL);
QVERIFY(tab.name() == "hopefully_working");
QVERIFY(tab.fields().at(0)->check() == "value NOT LIKE 'prefix%'");
}
QTEST_MAIN(TestTable)
//#include "testsqlobjects.moc"

View File

@@ -18,5 +18,5 @@ private slots:
void parseSQLWithoutRowid();
void parseNonASCIIChars();
void createTableWithIn();
void createTableWithNotLikeConstraint();
};