From 7804cdf8ecbc2bb40231199669444665df597eb6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 4 Jul 2021 19:32:42 +0100 Subject: Support copying exist table data --- test/sql/fillTestTable.sql | 2 ++ test/test-e2e.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 test/sql/fillTestTable.sql (limited to 'test') diff --git a/test/sql/fillTestTable.sql b/test/sql/fillTestTable.sql new file mode 100644 index 0000000..188107f --- /dev/null +++ b/test/sql/fillTestTable.sql @@ -0,0 +1,2 @@ +INSERT INTO session(session_id, username, user_lvl, ip_addr, port, created, modified) + VALUES('hashyhash', 'testuser', 'groupadm', '10.10.0.1', 2433, now(), now()); diff --git a/test/test-e2e.cpp b/test/test-e2e.cpp index 9906a0b..1921a08 100644 --- a/test/test-e2e.cpp +++ b/test/test-e2e.cpp @@ -6,6 +6,7 @@ #include "testdb-postgresql.h" #include #include +#include #include BOOST_AUTO_TEST_CASE(e2e) @@ -25,7 +26,9 @@ BOOST_AUTO_TEST_CASE(e2e) BOOST_REQUIRE(src); MyGrate::sql::createTestTable::execute(&mym); + MyGrate::sql::fillTestTable::execute(&mym); out.addTable(&mym, "session"); + out.copyTableContent(&mym, "session"); - BOOST_CHECK_EQUAL(MyGrate::sql::selectTestTable::execute(&pqm)->rows(), 0); + BOOST_CHECK_EQUAL(MyGrate::sql::selectTestTable::execute(&pqm)->rows(), 1); } -- cgit v1.2.3