summaryrefslogtreecommitdiff
path: root/test/test-mysql.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-06-13 01:09:01 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-06-13 01:09:01 +0100
commit6b453d0f0f50dccd0333d0d6e8cd0246e86d24a9 (patch)
tree5ca0f7347d41c1a0634123298963f7a8f9795a7d /test/test-mysql.cpp
parentAvoid direct use of runtime_error in PostgreSQL stuff (diff)
downloadmygrate-6b453d0f0f50dccd0333d0d6e8cd0246e86d24a9.tar.bz2
mygrate-6b453d0f0f50dccd0333d0d6e8cd0246e86d24a9.tar.xz
mygrate-6b453d0f0f50dccd0333d0d6e8cd0246e86d24a9.zip
Create and drop MySQL mock DBs as needed
Diffstat (limited to 'test/test-mysql.cpp')
-rw-r--r--test/test-mysql.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/test-mysql.cpp b/test/test-mysql.cpp
index 954a121..e4551f0 100644
--- a/test/test-mysql.cpp
+++ b/test/test-mysql.cpp
@@ -65,4 +65,7 @@ BOOST_AUTO_TEST_CASE(stmt)
BOOST_AUTO_TEST_CASE(mock)
{
MyGrate::Testing::MySQLDB db;
+ auto mdb = db.mock();
+ auto rs = MyGrate::DbStmt<"SELECT DATABASE()">::execute(&mdb);
+ BOOST_CHECK_EQUAL(rs->at(0, 0).get<std::string_view>().substr(0, 13), "mygrate_test_");
}