diff options
Diffstat (limited to 'libdbpp/unittests')
-rw-r--r-- | libdbpp/unittests/stringParse.sql | 1 | ||||
-rw-r--r-- | libdbpp/unittests/testConnection.cpp | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/libdbpp/unittests/stringParse.sql b/libdbpp/unittests/stringParse.sql index e764da9..736400b 100644 --- a/libdbpp/unittests/stringParse.sql +++ b/libdbpp/unittests/stringParse.sql @@ -1 +1,2 @@ INSERT INTO dollarQuotes(a) VALUES('apos''trophe'); +INSERT INTO name(t, i) VALUES('fancy string '' \' \r \n', 7); diff --git a/libdbpp/unittests/testConnection.cpp b/libdbpp/unittests/testConnection.cpp index b9cabdf..86ca2a8 100644 --- a/libdbpp/unittests/testConnection.cpp +++ b/libdbpp/unittests/testConnection.cpp @@ -82,6 +82,8 @@ BOOST_AUTO_TEST_CASE( parse ) BOOST_AUTO_TEST_CASE( parse2 ) { auto mock = DB::ConnectionPtr(DB::ConnectionFactory::createNew("MockDb", "doesn't matter")); + auto mockdb = boost::dynamic_pointer_cast<MockDb>(mock); + BOOST_REQUIRE(mockdb); std::fstream s; s.open((rootDir / "dollarQuote.sql").string()); @@ -95,6 +97,8 @@ BOOST_AUTO_TEST_CASE( parse2 ) s.open((rootDir / "stringParse.sql").string()); mock->executeScript(s, rootDir); s.close(); + BOOST_REQUIRE_EQUAL(4, mockdb->executed.size()); + BOOST_REQUIRE_EQUAL("INSERT INTO name(t, i) VALUES('fancy string '' \\' \\r \\n', 7)", mockdb->executed[3]); BOOST_REQUIRE_THROW({ s.open((rootDir / "unterminatedComment.sql").string()); |