Skip to content

Commit

Permalink
[FOLD] add response header tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vinniefalco committed Oct 20, 2016
1 parent 006e451 commit 8417de8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/http/headers_parser_v1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,34 @@ class headers_parser_v1_test : public beast::unit_test::suite
BEAST_EXPECTS(! ec, ec.message());
BEAST_EXPECT(p.complete());
}
{
error_code ec;
headers_parser_v1<false, headers> p;
BEAST_EXPECT(! p.complete());
auto const n = p.write(boost::asio::buffer(
"HTTP/1.1 200 OK\r\n"
"Server: test\r\n"
"\r\n"
), ec);
BEAST_EXPECT(n == 33);
BEAST_EXPECTS(! ec, ec.message());
BEAST_EXPECT(p.complete());
}
{
error_code ec;
headers_parser_v1<false, headers> p;
BEAST_EXPECT(! p.complete());
auto const n = p.write(boost::asio::buffer(
"HTTP/1.1 200 OK\r\n"
"Server: test\r\n"
"Content-Length: 5\r\n"
"\r\n"
"*****"
), ec);
BEAST_EXPECT(n == 52);
BEAST_EXPECTS(! ec, ec.message());
BEAST_EXPECT(p.complete());
}
}

void run() override
Expand Down

0 comments on commit 8417de8

Please sign in to comment.