25 lines
526 B
C++
25 lines
526 B
C++
#include <catch2/catch_test_macros.hpp>
|
|
#include <catch2/generators/catch_generators.hpp>
|
|
|
|
#include "matador/sql/connection.hpp"
|
|
|
|
using namespace matador;
|
|
|
|
TEST_CASE("Query test", "[query]") {
|
|
auto dns = GENERATE(as<std::string>{},
|
|
"sqlite://sqlite.db",
|
|
"postgres://test:test123@127.0.0.1:5432/matador_test" );
|
|
|
|
sql::connection c(dns);
|
|
REQUIRE(!c.is_open());
|
|
|
|
c.open();
|
|
REQUIRE(c.is_open());
|
|
|
|
c.close();
|
|
REQUIRE(!c.is_open());
|
|
|
|
INFO(dns);
|
|
REQUIRE(!dns.empty());
|
|
}
|