mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Tests: Add unit test for CHECK NOT LIKE constraint
Add a unit test for the grammar fix in
9cb0614ecf.
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -18,5 +18,5 @@ private slots:
|
||||
void parseSQLWithoutRowid();
|
||||
void parseNonASCIIChars();
|
||||
void createTableWithIn();
|
||||
void createTableWithNotLikeConstraint();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user