request parser speed improvements and test updates
Some checks failed
Docker Build & Publish / build (push) Failing after 2s
Some checks failed
Docker Build & Publish / build (push) Failing after 2s
This commit is contained in:
parent
95430a5dc3
commit
f930792a11
5 changed files with 127 additions and 78 deletions
17
tests/unit_tests.cpp
Normal file
17
tests/unit_tests.cpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <fstream>
|
||||
#include "../lib/http/request.hpp"
|
||||
#include <boost/beast.hpp>
|
||||
|
||||
TEST(unit_tests, single_request_parse) {
|
||||
std::ifstream t("./test_files/test_request.http");
|
||||
std::stringstream buffer;
|
||||
buffer << t.rdbuf();
|
||||
|
||||
std::string raw_req = buffer.str();
|
||||
std::string expected = buffer.str();
|
||||
|
||||
anthracite::http::request req (raw_req, "0.0.0.0");
|
||||
|
||||
ASSERT_EQ(expected, req.to_string());
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue