aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/Tests/ParserTest/tst_parsertest.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2016-06-13 18:42:57 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2016-06-13 18:42:57 -0400
commit65d5f68cc6dc81799c5a5d90400a2c1f0dd02547 (patch)
tree6f245ba901b87ef42fed69965aea22f5eea6b590 /SQLiteStudio3/Tests/ParserTest/tst_parsertest.cpp
parentaeb6bad01630d325a4e768e798a7a6d44e18fdaf (diff)
parent5d9314f134ddd3dc4c853e398ac90ba247fb2e4f (diff)
Merge tag 'upstream/3.1.0'
Upstream version 3.1.0 # gpg: Signature made Mon 13 Jun 2016 06:42:54 PM EDT using RSA key ID EBE9BD91 # gpg: Good signature from "Unit 193 <unit193@gmail.com>" # gpg: aka "Unit 193 <unit193@ninthfloor.org>" # gpg: aka "Unit 193 <unit193@ubuntu.com>" # gpg: aka "Unit 193 <unit193@ninthfloor.com>"
Diffstat (limited to 'SQLiteStudio3/Tests/ParserTest/tst_parsertest.cpp')
-rw-r--r--SQLiteStudio3/Tests/ParserTest/tst_parsertest.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/SQLiteStudio3/Tests/ParserTest/tst_parsertest.cpp b/SQLiteStudio3/Tests/ParserTest/tst_parsertest.cpp
index 4cec515..0dc58b0 100644
--- a/SQLiteStudio3/Tests/ParserTest/tst_parsertest.cpp
+++ b/SQLiteStudio3/Tests/ParserTest/tst_parsertest.cpp
@@ -20,6 +20,7 @@ class ParserTest : public QObject
Parser* parser3 = nullptr;
private Q_SLOTS:
+ void test();
void testUniqConflict();
void testGetTableTokens();
void testGetTableTokens2();
@@ -46,6 +47,31 @@ ParserTest::ParserTest()
{
}
+void ParserTest::test()
+{
+ QString sql = "CREATE TRIGGER param_insert_chk_enum "
+ "BEFORE INSERT "
+ "ON param "
+ "WHEN new.type = 'enum' AND "
+ "new.defval IS NOT NULL AND "
+ "new.defval != '' "
+ "BEGIN "
+ "SELECT RAISE(FAIL, 'param_insert_chk_enum failed') "
+ "WHERE NOT EXISTS ( "
+ "SELECT val "
+ "FROM valset "
+ "WHERE param_id = new.param_id AND "
+ "val = new.defval "
+ "); "
+ "END;";
+
+ parser3->parse(sql);
+ QVERIFY(parser3->getErrors().size() == 0);
+
+ SqliteQueryPtr query = parser3->getQueries()[0];
+ TokenList tokens = query->getContextTableTokens();
+}
+
void ParserTest::testGetTableTokens()
{
QString sql = "select someTable.* FROM someTable;";