diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test-ingest.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test-ingest.cpp b/test/test-ingest.cpp index 5f29806..1a62b70 100644 --- a/test/test-ingest.cpp +++ b/test/test-ingest.cpp @@ -5,6 +5,7 @@ #include "test-util.hpp" #include <ingestor.hpp> +#include <uaLookup.hpp> namespace { using namespace WebStat; @@ -181,3 +182,16 @@ BOOST_DATA_TEST_CASE(StoreLogLine, WebStat::Ingestor {WebStat::getTestUtsName("test-hostname"), std::make_shared<MockDBPool>("webstat")}.ingestLogLine( DB::MockDatabase::openConnectionTo("webstat").get(), line); } + +BOOST_AUTO_TEST_CASE(FetchRealUserAgentDetail, *boost::unit_test::disabled()) +{ + const auto uaDetail = WebStat::getUserAgentDetail( + R"(Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36)"); + + BOOST_TEST_CONTEXT(uaDetail) { + BOOST_CHECK(uaDetail.starts_with("{")); + BOOST_CHECK(uaDetail.ends_with("}")); + BOOST_CHECK(uaDetail.contains(R"("agent_type":)")); + BOOST_CHECK(uaDetail.contains(R"("os_type":)")); + } +} |