fixed backend tests

This commit is contained in:
Sascha Kühl
2025-02-13 16:13:20 +01:00
parent 2efb106fc3
commit 336b2a7342
17 changed files with 142 additions and 46 deletions
+6 -8
View File
@@ -37,15 +37,13 @@ void QueryFixture::check_table_not_exists(const std::string &table_name) const
}
void QueryFixture::drop_table_if_exists(const std::string &table_name) const {
const auto result = db.exists(table_name).and_then([&table_name, this](bool exists) {
const auto result = db.exists(table_name).and_then([&table_name, this](const bool exists) {
if (exists) {
if (query::query::drop()
.table(table_name)
.execute(db).is_ok()) {
this->check_table_not_exists(table_name);
} else {
FAIL("Failed to drop table");
}
auto res = query::query::drop()
.table(table_name)
.execute(db);
REQUIRE(res);
this->check_table_not_exists(table_name);
}
return utils::ok(true);
});