Skip to content
Snippets Groups Projects
Commit 55c49514 authored by florian's avatar florian
Browse files

WIP: Add test for COUNT query

parent 11e51ca7
No related branches found
No related tags found
1 merge request!6ENH: Add tests for queries
Pipeline #11565 failed
[requires]
caosdb/0.0.9
caosdb/0.0.10
gtest/1.11.0
[generators]
......
......@@ -529,6 +529,15 @@ TEST(test_transaction, test_query) {
EXPECT_EQ(query_transaction->GetResultSet().Size(), 1);
EXPECT_EQ(query_transaction->GetResultSet().At(0).GetId(),
new_entity.GetId());
// No count query, so no count result should be present
EXPECT_TRUE((query_transaction->GetCountResult() < 0));
auto count_query_trans(connection->CreateTransaction());
count_query_trans->Query("COUNT ENTITY WITH id = " + new_entity.GetId());
count_query_trans->Execute();
// No result set in a count query
EXPECT_EQ(count_query_trans->GetResultSet().Size(), 0);
EXPECT_EQ(count_query_trans->GetCountResult(), 1);
}
// TODO(fspreck) Add tests for unique queries, count queries, and mixed
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment