summaryrefslogtreecommitdiff
path: root/test/test-postgresql.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-postgresql.cpp')
-rw-r--r--test/test-postgresql.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test-postgresql.cpp b/test/test-postgresql.cpp
index eaf6d58..38feb3c 100644
--- a/test/test-postgresql.cpp
+++ b/test/test-postgresql.cpp
@@ -1,6 +1,7 @@
#define BOOST_TEST_MODULE PostgreSQL
#include <boost/test/unit_test.hpp>
+#include "testdb-postgresql.h"
#include <cstddef>
#include <dbConn.h>
#include <dbRecordSet.h>
@@ -73,3 +74,11 @@ BOOST_AUTO_TEST_CASE(stmt_reuse)
BOOST_CHECK_GT(rs->rows(), 1);
}
}
+
+BOOST_AUTO_TEST_CASE(mock)
+{
+ MyGrate::Testing::PqConnDB db;
+ auto mdb = db.mock();
+ auto rs = MyGrate::DbStmt<"SELECT CURRENT_DATABASE()">::execute(&mdb);
+ BOOST_CHECK_EQUAL(rs->at(0, 0).get<std::string_view>().substr(0, 13), "mygrate_test_");
+}