diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-03-13 21:27:04 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-03-13 21:27:04 +0000 |
commit | 8715f47325daf65fe12cb42bcf3fa33820e51c57 (patch) | |
tree | a22730f2e9b1c7f9deb647aa202f87ec6a2a93ef /libdbpp/unittests/testParse.cpp | |
parent | Add fwd headers to reduce the compile overheads of simple clients. (diff) | |
download | libdbpp-8715f47325daf65fe12cb42bcf3fa33820e51c57.tar.bz2 libdbpp-8715f47325daf65fe12cb42bcf3fa33820e51c57.tar.xz libdbpp-8715f47325daf65fe12cb42bcf3fa33820e51c57.zip |
Fix up SQL parsing in the presense of empty single-line commentslibdbpp-1.1.4.1
Diffstat (limited to 'libdbpp/unittests/testParse.cpp')
-rw-r--r-- | libdbpp/unittests/testParse.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libdbpp/unittests/testParse.cpp b/libdbpp/unittests/testParse.cpp index 093cc7d..b5f3d65 100644 --- a/libdbpp/unittests/testParse.cpp +++ b/libdbpp/unittests/testParse.cpp @@ -56,6 +56,22 @@ BOOST_AUTO_TEST_CASE( parse ) p.Execute(); BOOST_REQUIRE_EQUAL(p.executed.size(), 3); BOOST_REQUIRE_EQUAL(p.executed[1], "INSERT INTO name(t, i) VALUES('string', 3)"); + auto cs = { + "Single line comment", + "", + "", + "", + "", + "Comment", + "", + "", + "", + "Multi line\n\t comment", + "! Stupid MySQL terminates", + "! comments with a ;", + "! Because reasons", + }; + BOOST_CHECK_EQUAL_COLLECTIONS(p.comments.begin(), p.comments.end(), cs.begin(), cs.end()); } BOOST_AUTO_TEST_CASE( parseDollarQuote ) |